![microsoft word different headers on each page 2018 microsoft word different headers on each page 2018](https://www.skyneel.com/wp-content/uploads/2014/03/Inserting-Different-Header-and-Footer.jpg)
BuildingBlocks("MyHeader").Insert Selection.Range Or: With hdrF ObjTemplate.BuildingBlockTypes(wdTypeCustomHeaders).Categories("General") _ Categories("General").BuildingBlocks("MyHeader") Set objBB = objTemplate.BuildingBlockTypes(wdTypeCustomHeaders) _ Set objTemplate = ActiveDocument.AttachedTemplate Set ftrF = ActiveDocument.Sections(1).Footers(wdHeaderFooterFirstPage) Set hdrF = ActiveDocument.Sections(1).Headers(wdHeaderFooterFirstPage) In the World Wide Web I found some code snippets, and tried some things like that:ĭim hdrF As Word.HeaderFooter 'header first pageĭim ftrF As Word.HeaderFooter 'footer first page Otherwise you have to pay attention to the position of the insertion point.
Microsoft word different headers on each page 2018 how to#
_ BuildingBlockEntries("MyFooter").Insert Where:=Selection.Range, _ RichText:=TrueĪnd I don’t know how to say that just first page header/footer of section 1 are to be filled. I also would prefer not to have full template path in the macro, instead the macro should find the BBs in the template attached:Īpplication.Templates(" U:\Templates\Tests\Testletter.dotm"). But the last empty paragraph mark in the footer will not be deleted by the macro. I recorded a macro to insert custom header & footer building blocks and then delete the last empty paragraph mark within header/footer. After inserting those BBs into header & footer, there will be an additional unnecessary Will be printed on paper or exported to PDF.įor the letter template I created two building block entries (BBs), each of them containing a table and a small paragraph ( line spacing exactly 1 pt) behind. Just first page header & footer of first section are to be changed, depending on whether a letter But I am looking for a solution, to insert or to delete content of header & footer in a letter as needed. Obviously, macros are not my strength :-(.