Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Automation

Status
Not open for further replies.

alrandal

Programmer
Oct 1, 2002
27
0
0
US
I have an Access Database that fills in a word template using bookmarks, I have been using:

.ActiveDocument.Bookmarks("ESSP").Select
.Selection.Text = (CStr(Forms!FrmDocCreator!txtESSP))

to fill the bookmarks on my template, what I cant figure out is, how can I save this template to a seperate location then fill in the bookmarks, without losing my template?
When I fill the bookmarks, the template is filled and it asks if I want to save changes, If I say yes, then I wont have a template.
 
Save the word file as a template .dot file, then when you open it, it is clean and you will be prompted to save as another name. Regards
BrianB
** Let us know if you get something that works !
================================
 
I tried saving it as a .dot file and I get the same response from word. "Would you like to save the changes to the "".dot file" if I click yes then I will lose my template.
 
Ok Brian I did what you said and I saved the Word.doc as a .dot file and I used this code:

stESSPPath = "\\Path"
stSaveFileName = (CStr(Forms!FrmDocCreator!txtESSP) & (CStr(Forms!FrmDocCreator!txtRev)))
objWord.ActiveDocument.SaveAs stESSPPath & (stSaveFileName)
objWord.ActiveDocument.Close
It works good, it sends the newly copied template to my file path and it keeps my template blank for further use.
Thank You Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top