Big headache!
I want to open up a word document and display in the document data from fields that I have on my open Access form.
I have used a command button on click event to open up the required document as below:
Dim oApp As Word.Application
Dim oDoc As Word.Document
Set db = CurrentDb
Set oApp = CreateObject("Word.Application"
Set oDoc = oApp.Documents.Open("c:\My Documents\DocumentRequired.doc"
oApp.Visible = True
This works fine, what I want to do then is take text from some of the Access fields and place them into the document. I have set up bookmarks in the document but my following code does not work:
oDoc.editgoto "Name of Bookmark"
oDoc.Insert Form![Open Form]![Field Required]
I am trying to use code rather than use mail merge or doing the document as an Access report. Can anyone help PLEASE!!!!!!!!!
BH
I want to open up a word document and display in the document data from fields that I have on my open Access form.
I have used a command button on click event to open up the required document as below:
Dim oApp As Word.Application
Dim oDoc As Word.Document
Set db = CurrentDb
Set oApp = CreateObject("Word.Application"
Set oDoc = oApp.Documents.Open("c:\My Documents\DocumentRequired.doc"
oApp.Visible = True
This works fine, what I want to do then is take text from some of the Access fields and place them into the document. I have set up bookmarks in the document but my following code does not work:
oDoc.editgoto "Name of Bookmark"
oDoc.Insert Form![Open Form]![Field Required]
I am trying to use code rather than use mail merge or doing the document as an Access report. Can anyone help PLEASE!!!!!!!!!
BH