I’ve been having an extremely strange issue with a custom application. Basically the application is a form that displays to the user so they can select some options relating to how they want to print a document in Word. The form then goes off and does a few things with the printer driver and prints […]
It all became a reality when I right-clicked on my solution to add a new project. I thought I had made a mistake. How couldn’t I add a simple setup project after writing all that code? After a minute or two of intense (!) research, I received my answer: “Visual Studio setup projects (vdproj) will […]
Sometimes you need to add a slight pause in your VBA code to make things work properly. Here’s a few ways to do just that.
Ever needed to know what registry entries are required to register a COM DLL? Well I did recently.
Just found something very interesting in the release notes for WorkSite 8.3 SP3 Update 5 – all SDK components are now backwards-compatible with all previous 8.5 versions. Woohoo! No more updating code when going to SP3. That alone is worth the update!
Just a quick tip to save some time debugging classes. Did you know that if you make changes to a class, the changes don’t take effect until you re-instantiate the class? That’s why you don’t see your changes taking effect, or your breakpoints being hit. So, just re-run the AutoExec routine in the template you […]
In Word 2003, if you need to know if a document contains any VBA code/macros in it, you can use the following function. Function ContainsCode(ByVal Doc As Document) As Boolean ContainsCode = False Dim comp As Object For Each comp In Doc.VBProject.VBComponents If comp.CodeModule.CountOfLines > 0 Then ContainsCode = True Exit Function […]
I spend lots of time developing for different clients, and the problem is most clients have their own drive mappings pointing to specific network locations. In a lot of cases, I need to replicate these drive mappings as it’s usually where they store their Workgroup templates for Word, Excel and PowerPoint. So instead of setting […]
Do you have lots of custom toolbars in Word 2003 and can’t work out where they are coming from? I’ve had this problem so many times, especially when preparing lots of templates to move to 2010. Well, turns out it’s really simple – just run the following command in the immediate window in the VBA […]
One of my fave features in Word 2010 is the new custom undo records. It allows you to group your changes via code into blocks that can be undone in a single go – plus you can name the records. Take the following sub: Sub InsertSomeText() Selection.TypeText “This is a test” Selection.TypeParagraph Selection.TypeText “This is […]