Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-28-2014, 09:05 PM
McBanjo McBanjo is offline Macro for changing formatting of certain parts of a word Windows 7 64bit Macro for changing formatting of certain parts of a word Office 2013
Novice
Macro for changing formatting of certain parts of a word
 
Join Date: May 2014
Posts: 6
McBanjo is on a distinguished road
Question Macro for changing formatting of certain parts of a word

Hi Thread,



I have a really simple thing I want to do in Word 2013 Macros I'm sure, but having little knowledge of Macro scripting makes it difficult.

Here's the scenario. We have several products that have certain branding in a different font, two sizes larger than the standard Arial font and bolded. Easy enough, but the first few letters of the product name are also a different colour based on what product it is.

i.e. this:

abcphone
abcmobile
abcdesktop
abclaptop

to this:

abcphone
abcmobile
abcdesktop
abclatop


Here is something I've done so far:

Code:
Sub Branding()
'
' Branding Macro
'

   Selection.Find.ClearFormatting
   Selection.Find.Replacement.ClearFormatting
   With Selection.Find
        .Text = "abcphone"
        .Selection
        .Replacement.Text = ""
        .Replacement.Font.Bold = True
        .Replacement.Font.Name = "Myriad"
        .Forward = True
        .Wrap = wdFindContinue
        .MatchWholeWord = True
   End With
   Selection.Find.Execute Replace:=wdReplaceAll

End Sub
Any pointers on how to do this for every one of these words in a document? Any help would be greatly appreciated.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for changing formatting of certain parts of a word Need macro to merge files in Word and preserve formatting Carolin Word VBA 3 12-14-2014 04:01 AM
Macro for changing formatting of certain parts of a word Formatting Painter Issues - Changing Font Styles in .dot Jgreer0315 Word 12 02-06-2014 05:07 PM
Using Quick Parts >> Ref >> Field (Third word changing font) sonny49 Word 1 01-07-2014 10:01 AM
Macro for changing formatting of certain parts of a word Formatting changing constantly in Word sitash Word 1 04-16-2013 02:47 AM
Macro for changing formatting of certain parts of a word Formatting changing randomly Franuzz Word 1 07-14-2011 04:12 PM

Other Forums: Access Forums

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