Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-09-2020, 07:57 AM
jroozee jroozee is offline Font Property of ContentControl Box Doesn't work for SelectContentControlsByTitle Windows 10 Font Property of ContentControl Box Doesn't work for SelectContentControlsByTitle Office 2016
Novice
Font Property of ContentControl Box Doesn't work for SelectContentControlsByTitle
 
Join Date: Oct 2020
Posts: 2
jroozee is on a distinguished road
Default Font Property of ContentControl Box Doesn't work for SelectContentControlsByTitle

In my ContentControlOnExit event, I can update the contentControl (a Dropdown Box in my scase) font color of the contentcontrol that is triggering the event like this without any issues like this:



Code:
ContentControl.Range.Font.TextColor = RGB(255, 165, 0) 'Orange
However, if I try to update a DIFFERENT ContentControl in the document (not the one triggering the event), the .Font property is not found. Here is my code:

Code:
ActiveDocument.SelectContentControlsByTitle("passfail").Item(1).Range.Font.ColorIndex = RGB(255, 165, 0)'Orange
I get an error: 5843 "One of the values passed to this method or property is out of range".

I can set the text of the control without any issues like this:
Code:
ActiveDocument.SelectContentControlsByTitle("passfail").Item(1).Range
So I know the object is good up until the .Font property. It's the .Font property that is failing.


Basically, I have a compliance review document that has scoring in other drop-down boxes. When the user is done with the scoring, I am adding up the score and setting a dropdown box with "Passed", "Needs Improvement", or "Faile" And I want to update the color of tha dropdown to Green/Orange/Red accordingly.

I can update the font color of other dropdown boxes WHEN the ContentControlOnExit is triggered for THAT dropdown box without any issues. It's just when I try to update the font color of a DIFFERENT Dropdown box on the document that is not the active control.

What am I doing wrong?
Reply With Quote
  #2  
Old 10-09-2020, 08:40 AM
gmaxey gmaxey is online now Font Property of ContentControl Box Doesn't work for SelectContentControlsByTitle Windows 10 Font Property of ContentControl Box Doesn't work for SelectContentControlsByTitle Office 2016
Word MVP 2003-2009
 
Join Date: May 2010
Location: Marble, NC
Posts: 1,133
gmaxey has a spectacular aura aboutgmaxey has a spectacular aura aboutgmaxey has a spectacular aura about
Default

RGB(255, 165, 0) is not a colorindex


Change .Font.ColorIndex to .Font.Color
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #3  
Old 10-09-2020, 08:44 AM
jroozee jroozee is offline Font Property of ContentControl Box Doesn't work for SelectContentControlsByTitle Windows 10 Font Property of ContentControl Box Doesn't work for SelectContentControlsByTitle Office 2016
Novice
Font Property of ContentControl Box Doesn't work for SelectContentControlsByTitle
 
Join Date: Oct 2020
Posts: 2
jroozee is on a distinguished road
Default

Interesting. That does fix it. Even though Font.Color does not show up in the list of available properties.

Thanks
Reply With Quote
Reply

Tags
dropdown, font color

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Font Property of ContentControl Box Doesn't work for SelectContentControlsByTitle HelpViewer doesn't work dherr Office 1 03-27-2015 07:44 AM
(.left property) and (LockAspectRatio) don't work exceere Excel Programming 3 06-13-2014 05:03 AM
Font Property of ContentControl Box Doesn't work for SelectContentControlsByTitle alt+numeric doesn't work Kungen Word 3 12-02-2011 11:25 AM
CNTL+X doesn't work ACA Office 3 09-19-2011 10:42 AM
Font Property of ContentControl Box Doesn't work for SelectContentControlsByTitle Word 2007 Font Color Doesn't Work nnicko Word 2 04-16-2010 01:21 PM

Other Forums: Access Forums - Senior Forums

All times are GMT -7. The time now is 01:04 PM.


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