Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-19-2025, 05:52 PM
Astrid Astrid is offline In a style set font color to themecolor Windows 10 In a style set font color to themecolor Office 2019
Novice
In a style set font color to themecolor
 
Join Date: Apr 2022
Posts: 9
Astrid is on a distinguished road
Default In a style set font color to themecolor

I like to set the color of a font in a paragraph style to an accentcolor (from the document theme).

On a range I can use:
Selection.Font.Fill.ForeColor.ObjectThemeColor =wdThemeColorAccent2

however if I try to apply the color to a font in a style, I get an error 4680 (That property is not supported for this object)
ActiveDocument.Styles(wdStyleHeading1).Font.Fill.F oreColor.ObjectThemeColor = wdThemeColorAccent2

I can set the color if I use
ActiveDocument.Styles(wdStyleHeading1).Font.Color = ActiveDocument.DocumentTheme.ThemeColorScheme(msoT hemeAccent2)
however it doesn't point to the position in the theme but uses it's RGB. That's not what I want.


(Note that the .Color property of a font still works)

Does anybody know how to archieve this?
I was also wondering why I need the msoThemeAccent enum instead of the wdThemeColorAccent. I was under the impression that for Word objects I need the wdThemeColorAccent and for Office objects the msoThemeColor?
Reply With Quote
 

Tags
color, style, theme



Similar Threads
Thread Thread Starter Forum Replies Last Post
Style Font Color Changes After Close?? the.ronin Word 2 05-20-2018 07:26 PM
Style Font Color: Background 1 gmgj Word 3 12-20-2017 04:00 PM
In a style set font color to themecolor Hyperlink style won't accept font color or underlining Jennifer Murphy Word 14 03-19-2017 03:02 PM
Font Color Question//.Replacement.Font.Color = 12611584 rsrasc Word VBA 3 09-05-2015 09:03 PM
Setting Font Color and Style "permanently" wings1080 Word 5 12-19-2014 08:44 AM

Other Forums: Access Forums

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