*It's a puzzle to me why assigning the Footer.Range to a Range object works on the previous section's Footer, while Footer and ParagraphFormat are correct. RngSel.Paragraphs(1).Range.style = ActiveDocument.styles("Annexe1") Pf.TabStops.Add Position:=CentimetersToPoints(9.5), _ Pf.TabStops(CentimetersToPoints(18)).Position = _ Set ftr = ActiveDocument.Sections(rngSel.Sections(1).index).Footers(wdHeaderFooterPrimary) RngSel.InsertBreak Type:=wdSectionBreakNextPage This is not only faster and more accurate, it also reduces screen "flicker".Īt the end, the original Range (which has since moved beyond the original selection) is selected, since I assume you want to continue with text input at that point.
The big difference is, the code doesn't put any selection in the footer: everything is done directly. For instance, making each page Chapter specific (Chapter 1, Chapter 2, etc.) If there is a way to do this without some bloody difficult code, that would be very useful and much appreciated. Notice how these are then used to change the settings you have in your code. Hey guys, I'm editing a story in Microsoft Word, and wanted to know how you can make specific headers and footers that don't copy onto every sheet. Then the footer's Range.ParagraphFormat is assigned to a ParagraphFormat object*.
If the page orientation needs to be changed, the new section's footer is assigned to a Footer object. Removing Footers on a Single Page in Microsoft Word For whatever reason, you might need to remove a footer on a single page in a Word document, here’s how to get it done. It starts off by assigning the current selection to a Range object, then goes on to insert the Section Break and compare the page orientation, just as you have. The following works with Range objects (think of a Range like an invisible selection, but you can have many Ranges in your VBA code - there can be only one selection).
This is especially an issue with Headers and Footers when SeekView is used. It's always tricky when you work with Selection in VBA code - it doesn't always precisely mimic what happens when the user performs actions. I have tried the GoTo function, with page, section.but it doesn't do the trick. Unfortunately this changes the tabulations of the page just before.
Selection.Style = ActiveDocument.Styles("Annexe1") Position:=CentimetersToPoints(9.5), _Īlignment:=wdAlignTabCenter, Leader:=wdTabLeaderSpacesĪ = wdSeekMainDocument = wdOrientPortraitĪ = wdSeekCurrentPageFooter I have this code : Selection.InsertBreak Type:=wdSectionBreakNextPage I am trying to create a macro that creates a new page with a different orientation, and with a different tabulation.