Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Apr 2002
    Location
    United Kingdom
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Word template automation from Access (Access 97 & Word 2000)

    I have a form in my Access database with a button which opens a Word template once clicked... this I have achieved quite easily but I then need to be able to let the user make some changes to the text in the template and then do a 'Save As' to save the template as a .doc to their computer - my problem is that I then need the save path of the saved document to be returned to the VBA function that is assigned to the button on my form in Access.

    Is there any easy way of doing this, preferably without having any VBA code in the actual Word template?

    Any help much appreciated - thanks.

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Word template automation from Access (Access 97 & Word 2000)

    Access 97 doesn't have an easy way of doing this sort of thing - later versions include a File/Save Dialog capability. One suggestion would be to look at the Access 97 Developer's handbook - I believe they have an example of how to do this sort of thing either in the chapter on Automation or the one on importing and exporting. Another possibility would be this download from The Access Web.

    One issue however - what's to prevent the user from saving the document from Word and then closing Word? You might want to consider saving the document before you allow the user to modify it so you know in advance where it is being saved.
    Wendell

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word template automation from Access (Access 97 & Word 2000)

    You would have to control Word in code from Access. This is called Automation; if you search this forum for word automation, you will find several examples, and moderator <!profile=WendellB>WendellB<!/profile> has a short tutorial on his website: Automation 101.

  4. #4
    New Lounger
    Join Date
    Apr 2002
    Location
    United Kingdom
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word template automation from Access (Access 97 & Word 2000)

    Thank you both for your help - I shall have a look at the links that you have provided.

Posting Permissions

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