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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automating Word 2003 in Access 2007

Status
Not open for further replies.

Grem3

IS-IT--Management
Sep 3, 2007
5
GB
Hiya folks,

Hope you can help someone new to automation... I am writing a document in word from data in Access 2007 but cannot seem to get past first base! I have referenced the Word 12 object library and this is my test code:

Dim WordObj As Object
Set WordObj = New Word.Application

WordObj.Visible = True

Set WordObj = WordObj.Documents.Open("c:\Users\Duncan\Documents\Sunparadise\System\Templates\QuoteHeader.dot")

WordObj.Selection.TypeText "Hello"

Set WordObj = Nothing

I get "object does not support this property or method" on my typetext command. Can anyone tell me why this would be? I am sure it is something obvious but I can find only very limited help...

Ta,

Grem3
 
Dim WordObj As Object
Set WordObj = New Word.Application

WordObj.Visible = True
WordObj.Documents.Add Template:=("c:\Users\Duncan\Documents\Sunparadise\System\Templates\QuoteHeader.dot")
WordObj.Selection.TypeText "Hello"

Set WordObj = Nothing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top