L
LA Lawyer
I am trying to assemble a big document in Word using VBA.
The document already on the screen has footers and headers. I want to add
another document to follow it which does not need those headers or footers.
Here is my code, which is intuitive, but clearly wrong:
With Selection
.MoveEnd Unit:=wdStory, Count:=1
.InsertBreak Type:=wdSectionBreakNextPage
.InsertFile FileName:="n:\WordForms\Driving Instructions.docx",
Range:="", ConfirmConversions:=False, Link:=False, Attachment:=False
End With
I am attempting to have VBA insert this already-existing additional document
on a new page at the end of the active document. Instead, VBA keeps the
original header and footer, deletes all of the non-header text and then
inserts the new document there.
What am I doing wrong? I presume that this is a common procedure.
The document already on the screen has footers and headers. I want to add
another document to follow it which does not need those headers or footers.
Here is my code, which is intuitive, but clearly wrong:
With Selection
.MoveEnd Unit:=wdStory, Count:=1
.InsertBreak Type:=wdSectionBreakNextPage
.InsertFile FileName:="n:\WordForms\Driving Instructions.docx",
Range:="", ConfirmConversions:=False, Link:=False, Attachment:=False
End With
I am attempting to have VBA insert this already-existing additional document
on a new page at the end of the active document. Instead, VBA keeps the
original header and footer, deletes all of the non-header text and then
inserts the new document there.
What am I doing wrong? I presume that this is a common procedure.