How do I leave a page-header in VBA, after I copied 7 lines of text from a Word document, and copy this into the header of page 2, 3, 4,...
First off, I did a search to find the (unique word) "ongeval", that means accident.
Then, this line, and the 7 following lines have to be pasted into the pageheader (not on page 1).
This is what I made:
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Ongeval"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.HomeKey Unit:=wdLine
Selection.MoveDown Unit:=wdLine, Count:=7, Extend:=wdExtend
Selection.Copy
Selection.EndKey Unit:=wdStory
Selection.InsertBreak Type:=wdPageBreak
Selection.TypeText Text:="."
Selection.TypeParagraph
The VBA code from my previous thread, does work here.
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Paste
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
But now, the cursor "hangs" in the page-header.
How do I return to the document in VBA?
Thanks
Ward