Inserting blank page into document

R

rlampky

Cross posted to vba.beginners and word.formatting.longdoc

I am using the following Macros to locate the end of the active document and
then inserting a page break prior to inserting an Autotext entry in a word
document. The prior sections are protected forms.The insert section selected
by the gotoend macro is an unprotected section.

? how do I cause the new page to open without the headers or footers of the
current document

Sub gotoend()
'
' gotoend Macro
' Macro created 4/6/2004 by rjaco
'
Selection.GoTo What:=wdGoToBookmark, Name:="end"
With ActiveDocument.Bookmarks
.DefaultSorting = wdSortByName
.ShowHidden = False
End With


End Sub

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 4/6/2004 by rjaco
'
Application.Run MacroName:="gotoend"
Selection.InsertBreak Type:=wdPageBreak
ActiveDocument.AttachedTemplate.AutoTextEntries("test").Insert Where:= _
Selection.Range, RichText:=True
End Sub
 
J

Jezebel

Instead of a page break insert a new page section break. Then change the
headers and footers in the last section --

..LinkToPrevious = FALSE
..Range.Text = "" (or whatever you want)
 
D

Doug Robbins - Word MVP

Use

With ActiveDocument.Sections(2).Headers(wdHeaderFooterPrimary)
.LinkToPrevious = False
.Range.Delete
End With

Replace 2 with whatever the Section number is

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
R

rlampky

Thank you.

Doug Robbins - Word MVP said:
Use

With ActiveDocument.Sections(2).Headers(wdHeaderFooterPrimary)
.LinkToPrevious = False
.Range.Delete
End With

Replace 2 with whatever the Section number is

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top