#1
|
|||
|
|||
Changing the font colour in all text boxes
Hi All,
I have a document with lots of text boxes. Can anyone suggest a VBA method of changing the font colour in all of them at the same time. I'm trying to learn VBA and this seems like a good place to start. This is my first post here so please be kind to a newbie. regards marqives |
#2
|
||||
|
||||
Ideally, you'd start by defining an appropriate Paragraph Style or Character Style for the textbox content. You'd then apply that Style to all the textboxes. From then on, if you want to change any of the font attributes in the textboxes, all you'd need to do is to update the Style definition. No code required.
The programming problem at this stage, then, becomes one of applying your Style. For that you could use code like: Code:
Sub Demo() Dim Shp As Shape For Each Shp In ActiveDocument.Shapes With Shp If .Type = msoTextBox Then .TextFrame.TextRange.Style = "MyStyle" End If End With Next End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
font change colour, textboxes |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Changing the placeholder text for drop down boxes | DeadBatteries | Word | 1 | 08-24-2012 09:09 AM |
Arrows and text boxes disappear when changing view? | Jesse | Word | 4 | 06-12-2012 05:28 PM |
Font colour and format changing? | Lamya | Word | 5 | 05-16-2011 02:35 AM |
changing the colour of text box highlight in PowerPoint v.x | miki | PowerPoint | 1 | 11-16-2010 02:06 AM |
Bug in PPT 2007 - Font and line spacing in text boxes | Amateur | PowerPoint | 0 | 09-01-2010 03:34 AM |