Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #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: 255
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
 



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:08 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft