Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-29-2018, 06:41 AM
Mariostt1 Mariostt1 is offline Copy paste Header and Footer using VBA Windows 10 Copy paste Header and Footer using VBA Office 2016
Novice
Copy paste Header and Footer using VBA
 
Join Date: Jan 2018
Posts: 3
Mariostt1 is on a distinguished road
Smile Copy paste Header and Footer using VBA

Greetings,
I am searching for a solution for this problem, i am trying to find out a way to get the header and footer from a document and using vba macros to get them pasted over to other documents. I need this to waste as little time copy pasting a certain header and footer for my company project where every file needs to have the same header and footer.


Thank you for your time!
Reply With Quote
  #2  
Old 01-29-2018, 06:50 AM
gmayor's Avatar
gmayor gmayor is offline Copy paste Header and Footer using VBA Windows 10 Copy paste Header and Footer using VBA Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

There are potentially three headers and three footers for each section of a document. Which headers and footers are used in the source document and which are to be used in the target documents? Without this information the results may not be what you expect and could take even more time to address.

For new documents, create a template from your source document that contains the headers and footers and create new documents from it.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 01-29-2018, 06:53 AM
Mariostt1 Mariostt1 is offline Copy paste Header and Footer using VBA Windows 10 Copy paste Header and Footer using VBA Office 2016
Novice
Copy paste Header and Footer using VBA
 
Join Date: Jan 2018
Posts: 3
Mariostt1 is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
There are potentially three headers and three footers for each section of a document. Which headers and footers are used in the source document and which are to be used in the target documents? Without this information the results may not be what you expect and could take even more time to address.

For new documents, create a template from your source document that contains the headers and footers and create new documents from it.
Unfortunately the documents already exist and they do not have any header or footer and i have to insert them a specific one, is there another solution?
Thank you in advance!
Reply With Quote
  #4  
Old 01-29-2018, 03:36 PM
macropod's Avatar
macropod macropod is offline Copy paste Header and Footer using VBA Windows 7 64bit Copy paste Header and Footer using VBA Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

That's all very well, but you need to have a sound understanding of a Word document's structure before you can do this.
First: A document can contain multiple Sections. The second and subsequent sections may or may not have their headers & footers linked to the preceding Section.
Second: Every Section in a Word document has three header and footer objects:
• first page;
• even page; and
• primary.
The 'primary' header and footer are always active; whether the 'first page' and/or 'even page' header and footer are active for a given Section depends on what page layout options have been chosen for the document/section. You can't use the 'first page' and/or 'even page' header and footer unless the appropriate page layout options have been chosen.

Anything added to a 'first page' header or footer will only appear on the first page of the Section concerned (and the subsequent Section's 'first page' header or footer if that Section's page layout options provide for one and the subsequent Section's 'first page' header or footer, as appropriate, is linked to the previous Section's corresponding 'first page' header or footer).

Anything added to an 'even page' header or footer will only appear on the even pages of the Section concerned (and the subsequent Section's 'even page' header or footer if that Section's page layout options provide for one and the subsequent Section's 'even page' header or footer, as appropriate, is linked to the previous Section's corresponding 'even page' header or footer).

Subject to the the 'first page' and/or 'even page' page layout options, anything added to a 'primary' header or footer will appear on every page of the Section concerned (and the subsequent Section's 'primary' header or footer if that Section's 'primary' header or footer, as appropriate, is linked to the previous Section's corresponding 'primary' header or footer).

So, before anything could be coded, one would need to know whether:
• your source document has provided for all three header & footer objects;
• how you want the headers & footers in your target documents to be handled. For example, should the target documents be modified so that the header(s) & footer(s) from your source document be replicated only on the first page in them, or on the first page in every Section (this, of course, presupposes you already know how those documents are structured and what outcome would be appropriate).
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 01-31-2018, 06:08 AM
Mariostt1 Mariostt1 is offline Copy paste Header and Footer using VBA Windows 10 Copy paste Header and Footer using VBA Office 2016
Novice
Copy paste Header and Footer using VBA
 
Join Date: Jan 2018
Posts: 3
Mariostt1 is on a distinguished road
Default

Thank you for your time It was very helpful! Have a nice day
Reply With Quote
Reply

Tags
header



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to copy header and footer? Abcde Word 1 06-02-2017 06:08 AM
Copy paste Header and Footer using VBA How to copy excel sheet withe HEADER and Paste into new sheet? cloudforgiven Excel Programming 6 01-05-2017 07:30 PM
Copy paste Header and Footer using VBA Copy RightFooter, Delete Entire Footer, and Paste to LeftFooter reynolds0431 Word VBA 8 08-26-2015 09:01 PM
Header and footer aligned in the footer area ashiqghfr Word 2 07-23-2015 01:14 AM
Copy paste Header and Footer using VBA Paste Special: Copy and Paste Formatting Only? tinfanide Word 6 03-06-2013 12:21 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:06 AM.


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