#1
|
|||
|
|||
Balloon Text font and size macro
I am trying to create a macro that increases the font size and changes the font to arial for the balloon text and comment text. I grade a lot of student papers and the default font and size is too small. Is there anyone who can help me with this situation? I have attempted to create a macro but it doesn’t work when I open student’s documents. Thanks, Artimae |
#2
|
||||
|
||||
Try:
Code:
Sub Document_Open() With ActiveDocument With .Styles("Comment Text").Font .Name = "Arial" .Size = 12 End With With .Styles("Balloon Text").Font .Name = "Arial" .Size = 12 End With End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Just a note of caution. It's generally better to replace text descriptions of style names by the corresponding wdStyleBuiltIn constant as these work irrespective of the language version whereas the text version of style names change depending if you have an English or non-english version of word.
HOWEVER, Microsoft in their normal cack-handed way have updated the default styles provided in the Normal template but have not extended the wdStyleBuiltin enumeration to match. Thus you can replace 'Comment text' with wdStyleCommentText but you cannot replace and 'Balloon Text' with the (predicted) constant wdStyleBalloonText. Code:
Sub Document_Open() With ActiveDocument With .Styles(wdStyleCommentText).Font .Name = "Arial" .Size = 12 End With With .Styles(wdStyleBallonText).Font <- Error 'The requested memeber of the collection does not exist' .Name = "Arial" .Size = 12 End With End With End Sub |
#4
|
|||
|
|||
Thanks, all. I will give this a try.
Artimae |
#5
|
||||
|
||||
Quote:
FWIW a list of Word constants is available at: https://msdn.microsoft.com/en-us/lib...or=-2147217396
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
|||
|
|||
I have installed the macro and it's working fine.
Thanks for all your help. It will really save me time. Artimae. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Replace font size with macro | Itkind | Word VBA | 7 | 03-06-2017 01:48 PM |
Insert Text with specific Font Size | Nick70 | PowerPoint | 1 | 08-10-2016 09:56 AM |
Looping Macro to Change Font, Font Size, and Give Heading 1 | WH7262 | Word VBA | 1 | 08-26-2014 03:46 PM |
Font size of track changes balloon text | Oryctolagus | Word | 1 | 11-13-2013 09:27 AM |
MAcro to List all the Font & its size in a word document | shaukat74 | Word VBA | 1 | 01-29-2013 09:34 PM |