You are visitor number ????? since 21 April 2001.

Go to Howard Kaikow's home page

From time to time, I give or seek advice on using VBA in newsgroups and web forums. In order to share that knowledge, I may, from time to time, post information at my web site.

In some cases, the code is complex, or requires the construction of a Userform. It is easier to communicate such information by providing a Microsoft Word template file.

You may download my VBA Code Snippets template to see what, if any, wisdom I have chosen to share.

At this time, the template includes the following:

  1. Module modTestUserFormSDI, along with Userform frmUserformSDI: Microsoft Word 2000, at least on Windows, forces us to suffer with the SDI (Single Document Interface). One of the issues with SDI is when you, say, open a document, the running Userform may get covered by the newly opened document. In order to get around this problem, it is necessary to use Windows API calls to cause the focus to return to the Userform.

    This example demonstrates how to Activate a window, open a file, create a document, and close a document, yet retain the focus on the Userform.

    1. This example will not run on a non-Windows system and is not intended to run with Microsoft Word 97, do not even try.
    2. This code is intended to be used only by very experienced VBA programmers.
    3. I have not tested this example in Word 2002 or Word 2003 or Word 2007.

  2. Module modTestGetArrayBounds: Sample code for determining the number of dimensions in an array, and the lower and upper bound for each dimension.