Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-15-2017, 07:11 PM
Artimae Artimae is offline Balloon Text font and size macro Windows 10 Balloon Text font and size macro Office 2016
Novice
Balloon Text font and size macro
 
Join Date: Sep 2017
Posts: 4
Artimae is on a distinguished road
Default 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
Reply With Quote
  #2  
Old 11-15-2017, 09:01 PM
macropod's Avatar
macropod macropod is offline Balloon Text font and size macro Windows 7 64bit Balloon Text font and size macro Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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
Add the macro to your Normal template's 'ThisDocument' code module. Implemented that way, the macro will run every time you open any document. When you're not wanting to mark students' work, you might consider changing the macro's name to something else (e.g. FmtBlnAndCmnt) so it doesn't run every time you open any document. Renamed, it will only run if you select it manually.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 11-16-2017, 02:57 AM
slaycock slaycock is offline Balloon Text font and size macro Windows 7 64bit Balloon Text font and size macro Office 2016
Expert
 
Join Date: Sep 2013
Posts: 256
slaycock is on a distinguished road
Default

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
Therefore, if using a non-english version of word you need to use the correct language name for 'Balloon Text' etc.
Reply With Quote
  #4  
Old 11-16-2017, 04:17 PM
Artimae Artimae is offline Balloon Text font and size macro Windows 10 Balloon Text font and size macro Office 2016
Novice
Balloon Text font and size macro
 
Join Date: Sep 2017
Posts: 4
Artimae is on a distinguished road
Default

Thanks, all. I will give this a try.
Artimae
Reply With Quote
  #5  
Old 11-16-2017, 05:17 PM
macropod's Avatar
macropod macropod is offline Balloon Text font and size macro Windows 7 64bit Balloon Text font and size macro Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by slaycock View Post
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:
With .Styles(wdStyleBallonText).Font  <- Error 'The requested memeber of the collection does not exist'
You'd even get that error if the name wasn't misspelled (wdStyleBalloonText)

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]
Reply With Quote
  #6  
Old 11-16-2017, 05:20 PM
Artimae Artimae is offline Balloon Text font and size macro Windows 10 Balloon Text font and size macro Office 2016
Novice
Balloon Text font and size macro
 
Join Date: Sep 2017
Posts: 4
Artimae is on a distinguished road
Default

I have installed the macro and it's working fine.
Thanks for all your help. It will really save me time.
Artimae.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Balloon Text font and size macro 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
Balloon Text font and size macro Looping Macro to Change Font, Font Size, and Give Heading 1 WH7262 Word VBA 1 08-26-2014 03:46 PM
Balloon Text font and size macro Font size of track changes balloon text Oryctolagus Word 1 11-13-2013 09:27 AM
Balloon Text font and size macro MAcro to List all the Font & its size in a word document shaukat74 Word VBA 1 01-29-2013 09:34 PM

Other Forums: Access Forums

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