View Single Post
 
Old 07-12-2012, 01:59 PM
Amapola188 Amapola188 is offline Windows XP Office 2010 32bit
Novice
 
Join Date: Mar 2011
Location: Auckland, New Zealand
Posts: 6
Amapola188 is on a distinguished road
Default Open header to insert text into bookmark

Good Morning, my code breaks at line 3 (excluding comments) of below code. It says it can't find the bookmark. I have checked that the bookmark is there and spelling etc is all correct. - I suspect that it may not open the header and therefore don't find the bookmark in the main document?

Anybody any idea why this would be.

Code:
      
        'Open Header
         Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Name:="2"
         ActiveDocument.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
        
        'Insert Data into Header
         Selection.GoTo What:=wdGoToBookmark, Name:="BMQuoteNumberHeader"
         Selection.TypeText Text:=txtQuoteNumber.Text
        
        'Close Header
         ActiveDocument.ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
Thank you!

Christine
Auckland, NZ
Reply With Quote