
First of all, Happy New Year to everyone. Everything's gonna be fine in 2009, son!
It has already started out to be a very busy year for me, including a side project that I helped to get off the ground for a gaming guild. Before I was asked by one of the leaders of the Sinister Society Guild to start a website for them, I had no idea what a gaming guild was (probably because I'm not a gamer!); however, I quickly learned through the building this site.
Along with the basics, they needed a forum, a blog, a way to see their member list (complete with avatars), and a way to secure their site where only their guild members could see the "members only" sections (especially the forum!) And of course, since they don't make any money from this organization - they needed this done as inexpensively as possible.
The first step was to create a new look-and-feel established in a new master page, complete with a brand new logo and flash navigation from my brother Sebastian (thanks, bro!) ... which wasn't easy since we don't usually hang out in "sinister" gaming sites, but we found a way to give 'em what they needed. Then I used the following to quickly build the rest of their site:
- JumpyForum - I started off by finding forum code that I could easily implement into their existing site without ripping out a lot of its code, and JumpyForum fit the bill. Once it was in place, I totally switched out the screens with regular gridview controls and used the same database structure to make it fit the guild's needs.
- CliqueSite® NewsBlog - I needed the same thing for their blog, and I used CliqueSite® NewsBlog for it. It comes complete with comments, archiving, and RSS Feeds.
- ASP.NET Security - Didn't need to create customized security for this, so I just used the ASP.NET security and membership database to drive their security with 4 roles: Member, Assasin (a special member), Moderator (for forums), Administrator.
- ASP.NET Profiles - For all of the extra member information that they wanted to collect (like name, contact info, Xbox gamer tag, Guild Ranking, etc.), I used profile objects.
- Gravatar - Avatars are very important for gamers on the Internet, and this guild needed them to make their site legit. Fortunately for me, I didn't have to program a way for them to create them; within minutes I was able to implement Gravatar for free, that are managed by the tools they provide for you. And with a nifty custom control that is provided by Fresh Click Media, all I have to is pass in the e-mail address, tell it what size I want and I'm done. I was also able to specify the image to show when there isn't an Gravatar setup for a particular e-mail address.
Unfortunately, you won't be able to see any of these goodies unless you're an active member of the Sinister Society. But if you into playing the new game Darkfall (due to come out in the states the end of the month) and feel like you're "sinister" enough to hang with the big boys, feel free to apply for membership that I created using the wizard control.
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
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/
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.
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.