Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-15-2018, 09:25 PM
Peterson Peterson is offline VBA: how to get just header text, without formatting codes Windows 7 64bit VBA: how to get just header text, without formatting codes Office 2016
Competent Performer
VBA: how to get just header text, without formatting codes
 
Join Date: Jan 2017
Posts: 141
Peterson is on a distinguished road
Default VBA: how to get just header text, without formatting codes

I am trying to get the text from the LeftHeader, using the following code:

Code:
Sub Header() 

MyLeftHeader = ActiveSheet.PageSetup.LeftHeader
Debug.Print MyLeftHeader 

End Sub
Trouble is, in addition to the text, I end up with all of the formatting codes, as follows, for example:


&"Arial,Bold"&12Hello World.
Is there a way to get just the text, without the codes, as if I were to click into the header, select the text, and copy it?

I already have a macro to strip out the codes, so I don't need another -- I'm just wondering if there's a simpler way to get the text.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert raw field codes to plain text and back again ugcheleuce Word VBA 3 02-14-2017 05:03 AM
Converting field codes to plain text Jennifer Murphy Word 6 08-20-2014 05:10 AM
VBA: how to get just header text, without formatting codes Codes Popping Up In My Text? Faedrie Word 1 11-08-2012 01:00 AM
Field codes appearing in header/footer/TOC instead of actual text hgilberg Word 2 03-16-2012 02:52 PM
Convert LISTNUM field codes to text remedios43 Word 2 07-31-2011 09:21 AM

Other Forums: Access Forums

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