Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-01-2016, 02:55 PM
muiy muiy is offline Macro that changes color of all indented paragraphs Windows 8 Macro that changes color of all indented paragraphs Office 2013
Novice
Macro that changes color of all indented paragraphs
 
Join Date: Jan 2015
Posts: 7
muiy is on a distinguished road
Default 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.
Reply With Quote
  #2  
Old 08-01-2016, 03:43 PM
muiy muiy is offline Macro that changes color of all indented paragraphs Windows 8 Macro that changes color of all indented paragraphs Office 2013
Novice
Macro that changes color of all indented paragraphs
 
Join Date: Jan 2015
Posts: 7
muiy is on a distinguished road
Default

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.
Reply With Quote
  #3  
Old 08-01-2016, 08:18 PM
Charles Kenyon Charles Kenyon is offline Macro that changes color of all indented paragraphs Windows 8 Macro that changes color of all indented paragraphs Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,175
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Quote:
Originally Posted by muiy View Post
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.
You should do this using styles. By asking for a macro to do this, you are asking someone to reinvent the wheel.

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.
Reply With Quote
  #4  
Old 08-01-2016, 06:29 PM
Guessed's Avatar
Guessed Guessed is offline Macro that changes color of all indented paragraphs Windows 10 Macro that changes color of all indented paragraphs Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,997
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

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
Reply With Quote
  #5  
Old 08-01-2016, 06:49 PM
muiy muiy is offline Macro that changes color of all indented paragraphs Windows 8 Macro that changes color of all indented paragraphs Office 2013
Novice
Macro that changes color of all indented paragraphs
 
Join Date: Jan 2015
Posts: 7
muiy is on a distinguished road
Default

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.
Reply With Quote
Reply



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 that changes color of all indented paragraphs 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 that changes color of all indented paragraphs Macro Needed to delete Unwanted paragraphs in series frustrated teacher Word VBA 1 05-02-2014 03:32 PM
Macro that changes color of all indented paragraphs Eliminate paragraph breaks geobruin Word 1 06-12-2009 06:55 AM

Other Forums: Access Forums

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