Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-10-2014, 07:02 AM
cday cday is offline Word 2013 Windows 7 64bit Word 2013 Office 2013
Novice
Word 2013
 
Join Date: Jan 2014
Posts: 2
cday is on a distinguished road
Default Word 2013


In my Office 2013 MS Word the macro will not record the font color change. It will record the change in font type, size, and position, but not the color change. Has something changed in the new version of Word?
Reply With Quote
  #2  
Old 01-14-2014, 07:37 AM
NeilSC NeilSC is offline Word 2013 Windows 7 64bit Word 2013 Office 2013
Novice
 
Join Date: Dec 2013
Posts: 24
NeilSC is on a distinguished road
Default

I recorded a macro in Word 2013 to change the font color to red.

Notice the recorded line:
.Color = wdColorRed

Sorry, but I have no explanation why this line does not appear when you record the macro.

With Selection.Font
.name = "Times New Roman"
.Size = 11
.Bold = False
.Italic = False
.Underline = wdUnderlineNone
.UnderlineColor = wdColorAutomatic
.StrikeThrough = False
.DoubleStrikeThrough = False
.Outline = False
.Emboss = False
.Shadow = False
.Hidden = False
.SmallCaps = False
.AllCaps = False
.Color = wdColorRed
.Engrave = False
.Superscript = False
.Subscript = False
.Spacing = 0
.Scaling = 100
.Position = 0
.Kerning = 0
.Animation = wdAnimationNone
.Ligatures = wdLigaturesNone
.NumberSpacing = wdNumberSpacingDefault
.NumberForm = wdNumberFormDefault
.StylisticSet = wdStylisticSetDefault
.ContextualAlternates = 0
End With
Reply With Quote
  #3  
Old 01-14-2014, 08:20 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Word 2013 Windows 7 64bit Word 2013 Office 2013
Moderator
 
Join Date: Aug 2011
Posts: 3,902
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

The macro recorder has limitations, that is, recording is never perfect. (But note that in some respects recording is less useful than it was in older versions of Word.)

Which change are you trying to make? If you just want to apply a standard color to the selection, you can use:

Code:
Selection.Font.ColorIndex = wdBlue
You can see a list of WdColorIndex constants if you press F2 to display the Object browser in the Visual Basic Editor (Alt+F11).
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
  #4  
Old 01-14-2014, 03:27 PM
NeilSC NeilSC is offline Word 2013 Windows 7 64bit Word 2013 Office 2013
Novice
 
Join Date: Dec 2013
Posts: 24
NeilSC is on a distinguished road
Default

In Windows only (not Mac), you can also specify any color.

For example:
Selection.Font.Color = 13130340


Another example:


Selection.Font.Color = RGB(64, 128, 192)
Reply With Quote
  #5  
Old 01-16-2014, 11:58 AM
cday cday is offline Word 2013 Windows 7 64bit Word 2013 Office 2013
Novice
Word 2013
 
Join Date: Jan 2014
Posts: 2
cday is on a distinguished road
Default

Quote:
Originally Posted by Stefan Blom View Post
The macro recorder has limitations, that is, recording is never perfect. (But note that in some respects recording is less useful than it was in older versions of Word.)

Which change are you trying to make? If you just want to apply a standard color to the selection, you can use:

Code:
Selection.Font.ColorIndex = wdBlue
You can see a list of WdColorIndex constants if you press F2 to display the Object browser in the Visual Basic Editor (Alt+F11).
This is the fix I used in Visual Basic to make it work. Thanks for the help.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word 2013 Is it worth me getting 2013 Word? jm515400 Word 8 06-08-2014 03:48 AM
Word 2013 Word 2013: Hyperlinks in word created pdf open in web browser and not acrobat reader slaycock Word 5 03-08-2014 01:04 PM
Word 2013 Word 2013 vs Word 2010 formatting issue? rhoyt Word 1 12-07-2013 09:40 AM
Are user customizations transferable from Word 2003 to Word 2010 (2013)? New Daddy Word 3 01-14-2013 07:25 AM
Which ODF/ .odt version is word 2010, 2013 preview & eventually 2013 full using? semiotically Word 8 11-08-2012 05:44 PM

Other Forums: Access Forums

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