On both of those lines I think you need the Application object rather than the Document object.
Try replacing wrdDoc with the object you have for the application (maybe wrdApp.?), or wrdDoc.Application
However, this section of your code (with my comments):
could be replaced with this for the same effect:VB Code:
'select header wrdDoc.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader If wrdDoc.Selection.HeaderFooter.IsHeader = True Then 'if header is selected [which it is!], select footer wrdDoc.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter Else '.. else select header [should never happen] wrdDoc.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader End If
VB Code:
'select the footer wrdDoc.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter




Reply With Quote