I am trying to change some text in the header of a Word document. Below is my code:
I keep getting the error that it can't find the book mark even though I know it is there. I use the same book mark code in the body of the Word document and it works just fine.
Any help would be appreciated
PHP:
wordQuoteApp = New Word.Application()
wordQuoteApp.Documents.Open(filename:=strPath, readonly:=True)
wordQuoteDoc = wordQuoteApp.ActiveDocument
With wordQuoteApp
.ActiveWindow.ActivePane.View.SeekView = WdSeekView.wdSeekCurrentPageHeader
.ActiveWindow.ActivePane.Selection.GoTo(What:=Word.WdGoToItem.wdGoToBookmark, Name:="HeaderCustomerName")
.ActiveWindow.ActivePane.Selection.TypeText(Text:=txtCompanyName.Text)
End With
I keep getting the error that it can't find the book mark even though I know it is there. I use the same book mark code in the body of the Word document and it works just fine.
Any help would be appreciated