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

Ques. on sending text to a Word doc.

Status
Not open for further replies.

batteam

Programmer
Sep 12, 2003
374
US
I have Access 2000. Using an Access project, I want to simply send some text fields from a form in Access to a MS Word document. I can open the Word document OK but the code then ignores any code that is supposed to send data to the open document. A snippet of my code is:

Open Word application code here, then
With AppWord
.Documents.Add "Y:\xxxxx\xxxx\Test.doc"

.Selection.GoTo What:=wdGoToBookmark, Name:="firstName"
.Selection = varWordText
.Selection.GoTo What:=wdGoToBookmark, Name:="Text71"
.Selection.TypeText Text:="Beginning of the Action"
.Selection.GoTo What:=wdGoToBookmark, Name:="ActionText"
'Selection.TypeText Text:="Action Text Field!"
End With
etc. etc.

I'm thinking I should check to ensure I have the correct references set as, when comparing my code to examples in MS Help, Tek Tips FAQ pages and the internet, all seems OK. Any assistance would be appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top