I'm trying to add a new section to a document that is not linked to the header before or after the new section. This new section would have (1) text, (2), different header text plus an image, and (3) same footer. I've attached a sample document that has this section that I want to be able to insert anywhere else in the document.
I tried various different ways to accomplish this. The closest I've come is saving the new section including the page break after it as AutoText and then using the following macro to insert it elsewhere in the document:
Sub InsertSection()
' Unlink current section from previous section
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
ActivePane.View.Type = wdOutlineView Then
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.LinkToPrevious = Not Selection.HeaderFooter. _
LinkToPrevious
' Return to main document
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
' Insert Appendix AutoText
Application.Templates("C:\MyPath\My Macros.dotm"). _
BuildingBlockEntries("NewSection").Insert Where:=Selection.Range, _
RichText:=True
End Sub
While I do get the new section added where I want it, the header in the new section ends up repeating in the section after it even though I tried to unlink it in the macro prior to adding the new section. I even unlinked the header from the section that follows in the sample document prior to saving it as AutoText. I can't figure out how to get this to work right!
Any help would be greatly appreciated!
Cheryl