Visual Studio 2008 has a whole bunch of features in it that I never use, or have had the time to learn; but there are some features that all developers will find very useful. In Stephen Walther's post on the topic, he provides us with 10 of them ... 5 of which I knew about already - but the other features are good, too.

Essential Visual Studio Tips & Tricks that Every Developer Should Know

November 16, 2008 22:52 by RafaelV
E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Tracey and I have been on Facebook for about 2 weeks, so we're still getting the hang of things. While I was checking out some other features, I found that there's a development kit available to create applications using Facebook data using Visual Studio Express Editions - both web and windows applications. Could be useful!

http://www.microsoft.com/express/samples/facebook/

August 1, 2008 23:02 by RafaelV
E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

When I began my IT career back in 1992, I started out as a computer instructor for Computer Tutors USA teaching introductory classes in Windows 3.1, Microsoft Office, WordPerfect, dBase, and many more titles. I taught for 4 years; by that time I was teaching advanced courses, including advanced Access database programming. Those skills springboarded my career as a web developer.

Beginning in February 2007, I was excited to make my return to the classroom for Learning Tree International. I am a part-time instructor (which most of us are) teaching Course 512 - Developing ASP.NET Web Applications: Hands-On. Teaching this class every 2 months or so has been a great way for me to keep my ASP.NET skills sharp, because I always learn something new and am able to sharpen my saw by reviewing techniques that I normally don't use. The added bonus is meeting other aspiring ASP.NET developers and discussing the problems that they face; and if I'm lucky, I hopeful that I can give them a hand with whatever their goals they have for the course.

This gig also gives me the opportunity to visit places I've never been, and my next stop will be another first ... Philadelphia (yo, Adrian!!) I'll be there the week of June 23th, and this time I won't be in one of Learning Tree's education centers; this time I get to teach out of hotel, setting up laptops the day before - just like I used to for Computer Tutors. The only difference is that I don't have to worry about delivering all the hardware, someone else will be meeting there with that - so it should be a much better experience than back in the day.

And now that I've started my blog, I'll give you a recap of what I learn from this class (and all of my classes.) By the way, Learning Tree is always looking for expert IT specialists in all fields (not just programming) as well as business and project management. Let me know if you interested and can break away from your day job at least 4 weeks a year, and I'll put you in touch.

June 7, 2008 14:02 by RafaelV
E-mail | Permalink | Comments (1) | Comment RSSRSS comment feed

There are a few articles on the Internet that show how to automate the mail merge, including this one from Microsoft. However, most of the ones that I found also include code to create a data source and a form letter from scratch. If you already have the data, there's no reason re-populate it into a new data document - only to have to delete it when you done. And you certainly don't want to maintain form letter content from your code, either.

This article shows how to automate a Microsoft Word mail merge with an existing form letter (not generated from code), and the ability to connect to an existing data source without having to recreate it each time. Here are the steps:

The Form Letter

The document that is used to generate the letters (the form letter) should be setup the same way you always would in Microsoft Word 2003. However, when you setup the data source, go ahead and save it so that you ODC file it generates later. Go ahead and test the Mail Merge to make sure it works.

The Data Source File

The ODC file that you saved is under My Documents\My Data Sources. The advantage of having this file is that you can change the file when the database connection changes (i.e. when you move your application from development to production.)

The Application

This article uses a Microsoft Visual Studio 2005 solution in C# to build the windows application that performs the automatic mail merge. You'll need to add a reference to Microsoft Word 11.0 Object Library in order for this to work. Once you do that, here's the code you need to get it done.


Microsoft.Office.Interop.Word.ApplicationClass wordApp = new
  Microsoft.Office.Interop.Word.ApplicationClass();
Microsoft.Office.Interop.Word.Document wordDoc = new Microsoft.Office.Interop.Word.Document();
string rootpath = Application.StartupPath;
object vkMissing = System.Reflection.Missing.Value;
object vkReadonly = false;
object vkVisible = true;
object vkFalse = false;
object vkTrue = true;
object vkDynamic = 2;
object vkFileToOpen = (object)rootpath + "\\form_letter.doc";
wordApp.Visible = true;

try
{
  wordDoc = wordApp.Documents.Open(ref vkFileToOpen, ref vkMissing, ref vkReadonly,
  ref vkMissing, ref vkMissing, ref vkMissing, ref vkMissing, ref vkMissing,
  ref vkMissing, ref vkMissing, ref vkVisible, ref vkMissing, ref vkMissing, ref   vkMissing,
  ref vkMissing, ref vkMissing);

  wordDoc.Select();
  wordDoc.MailMerge.OpenDataSource(rootpath + "\\conn.odc", ref vkMissing,
  ref vkTrue, ref vkFalse, ref vkMissing, ref vkMissing, ref vkMissing, ref vkMissing,
  ref vkMissing, ref vkMissing, ref vkMissing, ref vkMissing, ref vkMissing, ref vkMissing,
  ref vkMissing, ref vkMissing);

  wordDoc.MailMerge.Destination =
  Microsoft.Office.Interop.Word.WdMailMergeDestination.wdSendToNewDocument;
  wordDoc.MailMerge.Execute(ref vkFalse);
}
catch (Exception ex)
{
  MessageBox.Show(ex.Message);
}
finally
{
  wordDoc.Close(ref vkMissing, ref vkMissing, ref vkMissing);
}

Here's a sample project that uses this code. This post is from my other blog and wanted to make sure it was included in this one so that I don't lose it. I have not tested this with Microsoft Word 2007; when I do, I'll give you the update. Good luck with it.

June 5, 2008 16:09 by RafaelV
E-mail | Permalink | Comments (1) | Comment RSSRSS comment feed