Access.2007.VBA.Bibl..

(John Hannent) #1
FIGURE 17.17
An Access report printed from a WSH script.

As a quick alternative to opening Word or Excel and selecting the correct template, you can also
use a WSH script to create a new Word document or Excel worksheet based on a template. This
technique can be useful when users have problems selecting the correct template to use when cre-
ating a new Word document or Excel worksheet. The New Document from Template.vbs script
listed next opens a new Word document based on a Word 97-2003 template located in the main
User Templates folder:

Dim appWord
Dim strTemplatePath
Dim strUserTemplatePath
Dim strTemplate
Dim docs

Part III Adding More Functionality to Office

Free download pdf