C
cmw
I have an MSAccess application which uses different templates. The user
clicks on a button in the Access form, and the application selects the
appropriate template, fills it with data from the database, saves and prints
it, then closes the document. The templates have a footer which prints the
current date and the page.
I need to add variable to the template which can be printed in the footer.
I've read some of the posts regarding document variables, but my code resides
in VB modules in Access, not in the Word documents, and I'm not sure how to
begin.
How do I create a variable in the template which can be populated by the
Access application and prints in the footer?
Code snippet:
Dim WordObj As Word.Application
Set WordObj = GetObject(, "Word.Application")
WordObj.Documents.Add Template:=TemplateFile, NewTemplate:=False
The application moves to bookmarks and prints variable data, sets fonts, etc.
clicks on a button in the Access form, and the application selects the
appropriate template, fills it with data from the database, saves and prints
it, then closes the document. The templates have a footer which prints the
current date and the page.
I need to add variable to the template which can be printed in the footer.
I've read some of the posts regarding document variables, but my code resides
in VB modules in Access, not in the Word documents, and I'm not sure how to
begin.
How do I create a variable in the template which can be populated by the
Access application and prints in the footer?
Code snippet:
Dim WordObj As Word.Application
Set WordObj = GetObject(, "Word.Application")
WordObj.Documents.Add Template:=TemplateFile, NewTemplate:=False
The application moves to bookmarks and prints variable data, sets fonts, etc.