Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-01-2022, 09:30 PM
Charles Kenyon Charles Kenyon is offline Automatically Using Complex headers and footers in new documents Windows 11 Automatically Using Complex headers and footers in new documents Office 2021
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,474
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

I do this.


I have one document that holds the header and footer in bookmarks.
My templates have an AutoNew macro that copies those bookmarks into the header and footer area in the document, overwriting any current content.

You could, instead, store your header/footer as AutoText in a Global Template. Then use AutoText fields in your templates/documents. You can use AutoNew / AutoOpen macros to update those fields. That is better, IMO, than using bookmarked text.

However, someone needs to know what to change when changes are needed.

In either of these, you edit the base and it gets updated when the template/documents are used.
Reply With Quote
  #2  
Old 07-02-2022, 03:43 AM
rogerbowering rogerbowering is offline Automatically Using Complex headers and footers in new documents Windows 10 Automatically Using Complex headers and footers in new documents Office 2010 32bit
Novice
Automatically Using Complex headers and footers in new documents
 
Join Date: Apr 2017
Posts: 15
rogerbowering is on a distinguished road
Default Very helpful

Hi Charles, very interesting and helpful, thank you

Some things there that I didn't know and, therefore haven't tried but I'll give them a go

Thanks again
Reply With Quote
  #3  
Old 07-02-2022, 03:54 AM
rogerbowering rogerbowering is offline Automatically Using Complex headers and footers in new documents Windows 10 Automatically Using Complex headers and footers in new documents Office 2010 32bit
Novice
Automatically Using Complex headers and footers in new documents
 
Join Date: Apr 2017
Posts: 15
rogerbowering is on a distinguished road
Default Just a quick follow up

My headers are ludicrous, There is so much code that it 'overflows' the header area and 'disappears' into the body (see image)

Of course once the document gets 'mailmerged' by our system then all that appears in the right jand column (under the logo) is a regular address; but the code needed to capture this is really excessive and what you can't see in the image is a some more rows for capturing the remainder of the address, plus office email address, phone

IS there a way to only see the header in Word display (in the same way you avoid seeing Headers in draft view), so the whole header bceomes visible for editing; in essence moving the horizontal row (named page header) down to reveal the whole thing.

As an indication, this is what the entire header code looks like (Yeah I know I can shift the margin of the right column temporarily so I can see the whole thing, but then I have overlapping text from the left text box and DRAFT 'watermark' and it all becomes very messy) please see below. When it is crammed in to the necessary narrow area below the logo it's a 'mare:


<%=applyEventToBusinessEntity(getEformObject(pageC ontext),"McLarens.DocumentTags.OfficeAddress1Event ")%><%if(!applyEventToBusinessEntity(getEformObjec t(pageContext),"McLarens.DocumentTags.OfficeAddres s2Event").equals("")){%>
<%=applyEventToBusinessEntity(getEformObject(pageC ontext),"McLarens.DocumentTags.OfficeAddress2Event ")%><%}%><%if(!applyEventToBusinessEntity(getEform Object(pageContext),"McLarens.DocumentTags.OfficeA ddress3Event").equals("")){%>, <%=applyEventToBusinessEntity(getEformObject(pageC ontext),"McLarens.DocumentTags.OfficeAddress3Event ")%><%}%> <%if(!applyEventToBusinessEntity(getEformObject(pa geContext),"McLarens.DocumentTags.OfficeAddress4Ev ent").equals("")){%><%=applyEventToBusinessEntity( getEformObject(pageContext),"McLarens.DocumentTags .OfficeAddress4Event")%>
<%}%><%=applyEventToBusinessEntity(getEformObject( pageContext),"McLarens.DocumentTags.OfficeCityEven t")%>, <%=applyEventToBusinessEntity(getEformObject(pageC ontext),"McLarens.DocumentTags.OfficePostCodeEvent ")%>
Tel: <%=applyEventToBusinessEntity(getEformObject(pageC ontext),"McLarens.DocumentTags.OfficePhoneEvent")% >
<%=applyEventToBusinessEntity(getEformObject(pageC ontext),"McLarens.DocumentTags.OfficeEmailEvent")% >

2 July 2022
Our Ref: <%=setLevel()%><%=getValue("CaseNumber")%>
Attached Images
File Type: jpg Header 1.jpg (128.0 KB, 25 views)
Reply With Quote
Reply

Tags
automation, headers, master



Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically Using Complex headers and footers in new documents Bulk/Batch update Word documents Headers and footers troyw Word VBA 8 05-05-2021 07:17 PM
a code that can change the layout for the headers and footers on each page automatically gmbh Word VBA 1 07-31-2014 04:24 AM
Macro for find/replace (including headers and footers) for multiple documents jpb103 Word VBA 2 05-16-2014 04:59 AM
Automatically Using Complex headers and footers in new documents Odd and Even Headers/Footers sarineochaos Word 1 02-04-2014 06:15 PM
Headers and Footers OverAchiever13 Word 1 05-27-2010 01:30 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:53 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft