Results 1 to 1 of 1
11-19-12, 12:54 #1Registered User
- Join Date
- Nov 2012
Unanswered: Use a Template to format Word doc generated from Access VBA button click
I have already accomplished creating a word document by clicking on a button.
Here is the code:
Private Sub CreateWord_Click()
On Error GoTo cmdOK_Error
Dim stDocName As String
stDocName = "Client-Status-Linda"
DoCmd.OutputTo acOutputQuery, stDocName, acFormatRTF, "Word.rtf", True
Also, I have attached the generated documented.
It generates a standard word document, however, I would like to be able to choose colors, font style, etc.
I know that you can use a template with the OutputTo method, however, I have not been successful in making it work.
expression.OutputTo(ObjectType, ObjectName, OutputFormat, OutputFile, AutoStart, TemplateFile, Encoding)
Please let me know how to accomplish generating a word file and formatting it with a template. Any help would be appreciated.