|
#1
|
|||
|
|||
Macro that changes color of all indented paragraphs
Hello,
I am trying to figure out how to create a macro that will format all tab-indented paragraphs to a particular color (the default Blue that you find in places like Customize Keyboard > All Commands > Color). In the past I have used Google to find macros that are useful to me, and in one case I asked about a macro on this forum and someone provided a macro that got me on the right track to figuring out a working one. I do understand that it would be better if I learned the Word macro language myself, but nevertheless, I am wondering if anyone can help me out with this? It would be much appreciated. |
#2
|
|||
|
|||
Perhaps a Style could accomplish the same task. I don't want the style to modify a document as I type; I would want it to apply all the formatting at once. I'm looking into that now.
|
#3
|
|||
|
|||
Quote:
With a style you can modify the formatting of designated areas by modifying the style and you can dramatically change formatting by changing to a different style. |
#4
|
||||
|
||||
Are you wanting to apply the colour to any paragraph that begins with a tab? If so, you could try this...
Code:
Sub ColourTabParas() Dim aPara As Paragraph For Each aPara In ActiveDocument.Paragraphs If Left(aPara.Range.Text, 1) = vbTab Then aPara.Range.Font.ColorIndex = wdBlue Next aPara End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#5
|
|||
|
|||
You rock! This works perfectly. I have been thinking "you need to take the time to ask this question" for over a year. Spoke with my boss today and she was also like, "I don't know why I never looked into this." It brings your School for the Gifted avatar to mind.
You just saved our company 1-2 hours of work per day if everyone uses this. I am not joking. You personally saved me 15-30 minutes of work every day. Thank you so much. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro Needed to delete Unwanted paragraphs within a table. | frustrated teacher | Word VBA | 0 | 06-05-2015 12:47 PM |
Macro to Insert text into the beginning on specific paragraphs unless the paragraph is blank | caboy | Word VBA | 2 | 04-01-2015 07:00 AM |
Want indents in outline to display indented | overdog | Word | 3 | 07-13-2014 05:54 AM |
Macro Needed to delete Unwanted paragraphs in series | frustrated teacher | Word VBA | 1 | 05-02-2014 03:32 PM |
Eliminate paragraph breaks | geobruin | Word | 1 | 06-12-2009 06:55 AM |