how do i start a word document from a template from inside acces.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to start a new document from a template that is stored in
c:\stationery\letter_head.dot from a macro or vb script from inside access
2002
 
First, go to Tools->References and add a reference to the
Word object model. Then, the following code will work:

Dim wd As Word.Application
Dim doc As Word.Document
Set wd = New Word.Application
Set doc = wd.Documents.Add
("c:\stationery\letter_head.dot")
wd.Visible = True

If you want to skip adding the references, you can use
late binding and:

Dim wd As Object
Dim doc As Object
Set wd = CreateObject("Word.Application")
Set doc = wd.Documents.Add("C:\template.dot")
wd.Visible = True

Chris Nebinger
 
Back
Top