T
Terry
I am trying to correct preexisting code to use Word 2007 or Word 2003. The
code opens and transforms an XML document. In 2007, it inserts the Header
Image fine, however when I run the code on amachine with 2003 I get an Error
on the ViewHeaderOnly ( "ViewHeaderOnly" on type '_ComObject' not found).
The code is as follows:
Dim wa As Microsoft.Office.Interop.Word.Application
Dim wd As Microsoft.Office.Interop.Word.Document
wa = New Microsoft.Office.Interop.Word.Application
wa.Documents.Open(REPORT_DATA_XML)
wd = wa.ActiveDocument
wd.TransformDocument(REPORT_TRANSFORM, True)
wa.WordBasic.ViewHeaderOnly()
Dim strValue As String
strValue = AppPath & "\ReportHeader.JPG"
wa.Selection.InlineShapes.AddPicture(FileName:=strValue, LinkToFile:=False,
SaveWithDocument:=True)
Any suggestions on how I could correct this to work in either 2007 or 2003?
Terry
code opens and transforms an XML document. In 2007, it inserts the Header
Image fine, however when I run the code on amachine with 2003 I get an Error
on the ViewHeaderOnly ( "ViewHeaderOnly" on type '_ComObject' not found).
The code is as follows:
Dim wa As Microsoft.Office.Interop.Word.Application
Dim wd As Microsoft.Office.Interop.Word.Document
wa = New Microsoft.Office.Interop.Word.Application
wa.Documents.Open(REPORT_DATA_XML)
wd = wa.ActiveDocument
wd.TransformDocument(REPORT_TRANSFORM, True)
wa.WordBasic.ViewHeaderOnly()
Dim strValue As String
strValue = AppPath & "\ReportHeader.JPG"
wa.Selection.InlineShapes.AddPicture(FileName:=strValue, LinkToFile:=False,
SaveWithDocument:=True)
Any suggestions on how I could correct this to work in either 2007 or 2003?
Terry