Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 10-23-2019, 12:30 AM
Guessed's Avatar
Guessed Guessed is offline Adding text to the header and footer without removing all other content in the header and footer Windows 10 Adding text to the header and footer without removing all other content in the header and footer Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,185
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Your template doesn't have any graphics in the header so not sure about that part of your request, however when you set the .Range.Text you are replacing whatever used to be there.

Because you are using a template, it should already have the placeholder text sitting in the header/footers and it should already be styled. This dramatically reduces the things you need to do with your code. You can also use Linked Content Controls to further minmise the code. For instance, if your Content Control was linked to the document's Keywords Property you could just do...
Code:
Private Sub cmdSetClassification_Click()
  ' prepare header footers..
  Dim sHeadFooter As String
  sHeadFooter = Me.txtFurtherInfo.Text
  ActiveDocument.BuiltInDocumentProperties("Keywords") = sHeadFooter
  Unload Me
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 

Tags
header and footer



Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing header from one page but not footer smithurmann Word 1 12-15-2018 11:24 AM
Removing header and footer on two pages in my document oliboi Word 1 11-01-2016 05:27 PM
Header and footer aligned in the footer area ashiqghfr Word 2 07-23-2015 01:14 AM
Adding text to the header and footer without removing all other content in the header and footer Created VBA to Find and Replace in Body, Header and Footer with Highlighting the replacement text QA_Compliance_Advisor Word VBA 11 09-23-2014 04:40 AM
Field codes appearing in header/footer/TOC instead of actual text hgilberg Word 2 03-16-2012 02:52 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:01 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