G
Greg Maxey
I am trying to assist someone remotely isolate a runtime error occurring in
their code. I can't duplicate it on my PC.
They have a procedure that performs the following:
Selection.EndKey Unit:=wdStory
Selection.InsertBreak Type:=wdPageBreak
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.TypeText Text:="Hdrlogo"
Selection.Range.InsertAutoText
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
Selection.TypeBackspace
Selection.GoTo what:=wdGoToBookmark, Name:="bkStop"
Basically it goes to the end of the document, inserts a page break, goes to
the header, inserts some text, converts that text to an AutoText entry, then
returns to a bookmark in the main text.
It works without issue on my PC and several PCs in the users firm. On one
PC the code fails on this line:
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
With the following error message: Run-time error '91:
Object variable or with
block variable not set.
I can not reproduce this error.
Any ideas? Thanks.
their code. I can't duplicate it on my PC.
They have a procedure that performs the following:
Selection.EndKey Unit:=wdStory
Selection.InsertBreak Type:=wdPageBreak
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.TypeText Text:="Hdrlogo"
Selection.Range.InsertAutoText
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
Selection.TypeBackspace
Selection.GoTo what:=wdGoToBookmark, Name:="bkStop"
Basically it goes to the end of the document, inserts a page break, goes to
the header, inserts some text, converts that text to an AutoText entry, then
returns to a bookmark in the main text.
It works without issue on my PC and several PCs in the users firm. On one
PC the code fails on this line:
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
With the following error message: Run-time error '91:
Object variable or with
block variable not set.
I can not reproduce this error.
Any ideas? Thanks.