Office Automation - Word Headers/Footers

sphudson

New member
Joined
Jan 17, 2007
Messages
1
Programming Experience
1-3
I am trying to change some text in the header of a Word document. Below is my code:

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
 
Back
Top