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.
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.