C
Chris
I am using automation to get data from access to the subject property of a
word document and then insert this into the document using the following
code.
Sub CreateWordDocument()
On Error GoTo Err_CreateWordDocument:
Set m_appWd = GetObject(, "Word.application") 'open word if currently open
If m_appWd Is Nothing Then 'if word is not open create a new instance of
word
Set m_appWd = CreateObject("Word.application")
End If
Set m_docReport = m_appWd.Documents.Add(Template:="C:\bcquote.dot",
NewTemplate:=False)
With m_docReport
.BuiltInDocumentProperties("Subject").Value = Form_Quotes.ProjectName
.Fields.Update
End With
Err_exit:
Exit Sub
On the template there is a field { Subject \* mergeformat} which seems to
merge ok just the data shows up three times any ideas why?
Thanks
Chris
word document and then insert this into the document using the following
code.
Sub CreateWordDocument()
On Error GoTo Err_CreateWordDocument:
Set m_appWd = GetObject(, "Word.application") 'open word if currently open
If m_appWd Is Nothing Then 'if word is not open create a new instance of
word
Set m_appWd = CreateObject("Word.application")
End If
Set m_docReport = m_appWd.Documents.Add(Template:="C:\bcquote.dot",
NewTemplate:=False)
With m_docReport
.BuiltInDocumentProperties("Subject").Value = Form_Quotes.ProjectName
.Fields.Update
End With
Err_exit:
Exit Sub
On the template there is a field { Subject \* mergeformat} which seems to
merge ok just the data shows up three times any ideas why?
Thanks
Chris