LJtechnical
Technical User
Hi All,
I am trying to access the header and footer of a word template as it is opened in order to automate the input of text from an access table. I have the following code which works fine when I step through the code but not in the automation:
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
ActivePane.View.Type = wdOutlineView Or ActiveWindow.ActivePane.View.Type _
= wdMasterView Then
ActiveWindow.ActivePane.View.Type = wdPageView
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
All this gives, is the ever helpful "object variable or with block variable not set" any ideas?
Thanks
Dave
I am trying to access the header and footer of a word template as it is opened in order to automate the input of text from an access table. I have the following code which works fine when I step through the code but not in the automation:
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
ActivePane.View.Type = wdOutlineView Or ActiveWindow.ActivePane.View.Type _
= wdMasterView Then
ActiveWindow.ActivePane.View.Type = wdPageView
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
All this gives, is the ever helpful "object variable or with block variable not set" any ideas?
Thanks
Dave