|
This Microsoft Word Tips & Microsoft Word Help page
provides a VBA template AddIn solution for the task of listing files and
selected file data located in any folder and sub-folders. You
could use it to create a list of files in your favorite folders, flash
thumb drives, or floppy discs.
It is a collaborative effort by Word MVPs
Greg Maxey, Graham Mayor, and Excel MVP Andy Pope. Graham gets
credit for dogged development reviews and criticism which led to many
improvements. Andy Pope's class to emulate control tip text on userforms
"What's this
help" and his suggestions for adapting it to include
frame controls adds control tip enhancements to the Word2007 AddIn. |
|
I have prepared two versions of the AddIn that you
can download here:
ListFileTemplates.
Both versions can be loaded manually as template AddIns or be
placed in the Word Startup folder as a global AddIn. The Word2003
version also works in Word2007 but does not contain the control tip
enhancements. The user interface with the AddIns are shown below: |
|

Word2003 User Interface |
|

Word2003 Version used with Word2007 |
|

Word2007 User Interface
Bonus
Tip: If you want to change the group name see my:
Customize the Ribbon - (It doesn't
take Rocket Science) |
|
Clicking on the user interface command opens the
AddIn user interface shown below. With this interface you type in
or browse for the folder you wish to process. You have the option
to list only files in the selected folder or files in the selected
folder and any files contained in sub-folders of that folder. In
addition to listing all files, you can filter the listing to show only
Office type files, and select the scope of file data included in the
list. When you have selected your options you simply press the
Create List interface command. |
|

Word2003 Version UI |

Word2007 Version UI |
|
After selecting the option and clicking "Create
List", Word generates a new formatted document listing the file
information selected in options. |
|

|
|

|
|
That's all there is to it. |
|
While developing these AddIns I learned that I
couldn't create multi-line control tooltip text.
I
wanted users to be aware that selecting "Include Sub-Folders" could be
problematic. To solve this issue I took two routes (hence the two
versions of the AddIn).
The Word2007 version contains an enhanced
control tooltip feature made possible by an interesting and brilliant
Class module developed by Andy Pope. With Andy's assistance,
I customized this module for use in the AddIn. The User Interface
includes a "?" command button that activates the feature. When you
click the command, then click a User Interface control, enhanced control
tool tip text can be displayed. |
|

|
|
The Word2003 version provides an alternate means
of displaying enhanced tooltip text offers a registry
setting option to suppress repeated displaying the tip. When you click on the
"Include Sub-Folders" control a second UserForm is displayed with
enhance tooltip text. This UserForm displays each time the control
is selected. You can suppress displaying the UserForm by checking
the control shown. |
|

|
|
All of the document formatting, VBA project
modules, userforms, and class modules code used to develop these AddIns
are fully accessble in the templates you down load. |