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!

Attach a template to a Word Document...

Status
Not open for further replies.

Wrangler36

Technical User
Dec 5, 2005
24
0
0
US
I did a search on the forum and could not find an answer to this question:

I need to attach a template file (myFile.dot) to a Word document (myDocument.doc) located on the local disk drive (C:\myLocation) from WITHIN Access, then I need to open the Word document (myDocument.doc) and leave it open.

I'm sure this has a simple solution, I'm just not too familiar with working with Word documents from within Access.

Any suggestions will be most appreciated.

Thanks.
 
A starting point:
Dim WA As Object
Set WA = CreateObject("Word.Application")
WA.Documents.Open "C:\myLocation\myDocument.doc"
WA.ActiveDocument.AttachedTemplate = "C:\myLocation\myFile.dot"
WA.Visible = True
Set WA = Nothing

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks PHV. That worked great!


I now have another issue with Word, but I will start another post, since it is unrelated to this one.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top