Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-10-2011, 12:30 AM
ballj_35 ballj_35 is offline Macro to Replace Fonts Windows XP Macro to Replace Fonts Office 2007
Novice
Macro to Replace Fonts
 
Join Date: May 2011
Posts: 9
ballj_35 is on a distinguished road
Default Macro to Replace Fonts

Everyone,



Can someone direct me to how to create a macro to convert/replace fonts in a document. I have several documents that get sent to me as Word documents. I would like to have a macro that will change all the fonts in the document to fonts that we use for another product.
For example, from "Times New Roman, 8pt, Bold" to "XTN08B" or from "Courier, 10pt, Italic" to "XCO10I". Do I need to have a table defined somewhere that has my from and to values? Then loop through the table with the from and to values going against the document replacing the font if it finds it?
The product we use has special Fonts that we use, but they are all True Type Fonts. What would be the best way to accomplish this? Was told by the users, they used a macro in Word 2003 before to do this, but they lost the macro and the one I find they tell about, does not work like they want it to. I accepted the challenge to write one for them, but I need some guidance from more experienced people.
Any assistance would be greatly appreciated. Thanx in advance.

Jerry
Reply With Quote
  #2  
Old 05-10-2011, 12:39 AM
macropod's Avatar
macropod macropod is offline Macro to Replace Fonts Windows 7 32bit Macro to Replace Fonts Office 2007
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

Hi Jerry,

Providing the document is correctly formatted via the use of Styles, all you should need to do is to change the font used by the Styles. Simply overriding the Style definitions is a bad idea.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 05-10-2011, 12:51 AM
ballj_35 ballj_35 is offline Macro to Replace Fonts Windows XP Macro to Replace Fonts Office 2007
Novice
Macro to Replace Fonts
 
Join Date: May 2011
Posts: 9
ballj_35 is on a distinguished road
Default

We use a product called Documerge and we need to change the fonts to how they are defined in the metacode. Just trying to create a macro, that will convert the Windows Fonts to the Fonts that are used for Documerge.
It may be a bad idea, but that is the charter.

Jerry
Reply With Quote
  #4  
Old 05-10-2011, 01:10 AM
macropod's Avatar
macropod macropod is offline Macro to Replace Fonts Windows 7 32bit Macro to Replace Fonts Office 2007
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

Hi Jerry,

It doesn't really matter how the document was created; what matters is whether that process observed the proper conventions for using Styles for formatting. If it did, then the solution rmains as I said in my previous post - simply change the font names in the Style definitions.

You can, of course, use Find/Replace to simply replace all instances of one font with another. The macro recorder will create a fairly efficient macro for this. I'm not sure where the tables figure in this, though. If a particular font you're wanting to replace is only used in tables, no worry. If it's used outside the table as well and you want to replace only the fonts within the tables, then the macro recorder doesn't provide that level of control. Post back if this is the case.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to Replace Fonts Help with find and replace or query and replace shabbaranks Excel 4 03-19-2011 08:38 AM
Macro to Replace Fonts Help with fonts and forms Natebond008 Word 2 06-05-2010 12:38 PM
Fonts List kai1 Word 0 02-22-2010 04:16 PM
Missing Fonts cstorer44@aol.com Word 0 03-06-2009 01:28 PM
Find and Replace Macro - A Better Way Tribos Word VBA 0 10-08-2008 03:22 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:42 PM.


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