Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 02-14-2018, 01:03 PM
macropod's Avatar
macropod macropod is offline Multi-File Header Change Windows 7 64bit Multi-File Header Change Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

In that case, if you run the macro from a document containing the required header, you could simply delete:
Code:
StrTxt = InputBox("Text to add to headers? e.g. ""March 1, 2018""")
If Trim(StrTxt) = "" Then Exit Sub
and change:
.Sections(1).Headers(wdHeaderFooterPrimary).Range. InsertAfter StrTxt
to:
Code:
            With .Sections(1).Headers(wdHeaderFooterPrimary).Range
              .FormattedText = wdDocSrc.Sections(1).Headers(wdHeaderFooterPrimary).Range.FormattedText
              .Characters.Last.Delete
            End With
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word 2016 Multi-file Macro issues IneedHelpWithWord Word VBA 1 08-08-2017 09:29 PM
Multi-File Header Change Multi change text DrDress Word 4 04-17-2017 06:39 PM
Multi-File Header Change Copy and Paste from File to File but File Names always change aaronbauer1980 Excel Programming 1 04-15-2016 05:53 PM
Multi-File Header Change Split multi-page mail merge document, then name file from letter info. BriMan83 Mail Merge 1 04-24-2013 11:35 PM
Multi-File Header Change Word insert only 1st page of multi-paged PDF file Evgeniy Word 1 02-04-2012 01:36 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:26 AM.


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