Results 1 to 1 of 1
  1. #1
    Join Date
    Nov 2012
    Posts
    1

    Use a Template to format Word doc generated from Access VBA button click

    Hello,

    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
    cmdOK_Error:
    Resume Next
    End Sub

    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.



    Thanks


    Linda
    Attached Files Attached Files

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •