Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-22-2012, 05:59 PM
tinfanide tinfanide is offline Codes for Word Textbox Font Color? Windows 7 64bit Codes for Word Textbox Font Color? Office 2010 32bit
Expert
Codes for Word Textbox Font Color?
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default Codes for Word Textbox Font Color?

I've been searching the Internet for the codes but haven't yet found it. Could someone here point me how to do it? I want a No-Fill for the texts.



Code:
ActiveDocument.Shapes(1).Font.ColorIndex ...
This just highlights the texts, not change of the font colour.
Thanks in advance.
Reply With Quote
  #2  
Old 10-22-2012, 07:13 PM
macropod's Avatar
macropod macropod is offline Codes for Word Textbox Font Color? Windows 7 64bit Codes for Word Textbox Font Color? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

There is no '.Shapes(1).Font' property. Try something along the lines of:
ActiveDocument.Shapes(1).TextFrame.TextRange.Font. ColorIndex = wdDarkBlue
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 10-22-2012, 08:25 PM
tinfanide tinfanide is offline Codes for Word Textbox Font Color? Windows 7 64bit Codes for Word Textbox Font Color? Office 2010 32bit
Expert
Codes for Word Textbox Font Color?
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
There is no '.Shapes(1).Font' property. Try something along the lines of:
ActiveDocument.Shapes(1).TextFrame.TextRange.Font. ColorIndex = wdDarkBlue
Yes, I've got it wrong. It should be TextFrame.TextRange.Font...
Yet, I would like to know when I insert a text box with a few texts, how can I text fill it with no fill? Cos in Font.ColorIndex, we don't have the "No Fill" option.
Reply With Quote
  #4  
Old 10-22-2012, 08:45 PM
macropod's Avatar
macropod macropod is offline Codes for Word Textbox Font Color? Windows 7 64bit Codes for Word Textbox Font Color? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

There is no such thing as a "No Fill" Font.ColorIndex. What are you trying to achieve?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 10-22-2012, 11:27 PM
tinfanide tinfanide is offline Codes for Word Textbox Font Color? Windows 7 64bit Codes for Word Textbox Font Color? Office 2010 32bit
Expert
Codes for Word Textbox Font Color?
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
There is no such thing as a "No Fill" Font.ColorIndex. What are you trying to achieve?
Draw a text box.
Type some texts inside.
Go to the Format ribbon.
There should be a Text Fill option and under that,
I chose No Fill.
In effect, the texts are hidden.

Just cannot find how to do it in VBA.
Reply With Quote
  #6  
Old 10-22-2012, 11:39 PM
macropod's Avatar
macropod macropod is offline Codes for Word Textbox Font Color? Windows 7 64bit Codes for Word Textbox Font Color? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

I do not see a 'Text Fill' option. There is a 'Shape Fill' option, but that has nothing to do with the text colour.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 10-23-2012, 03:34 AM
tinfanide tinfanide is offline Codes for Word Textbox Font Color? Windows 7 64bit Codes for Word Textbox Font Color? Office 2010 32bit
Expert
Codes for Word Textbox Font Color?
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default

Word2010-Textbox-TextFill.jpg

Should have attached a print-screen.
Reply With Quote
  #8  
Old 10-23-2012, 03:13 PM
macropod's Avatar
macropod macropod is offline Codes for Word Textbox Font Color? Windows 7 64bit Codes for Word Textbox Font Color? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

OK, you're evidently not working in Compatability mode. In that mode, one doesn't get to see anything to do with Word Art on the Drawing Tools tab.

You can achieve the 'no fill' effect by setting the text visibility to false:
ActiveDocument.Shapes(1).TextFrame.TextRange.Font. Fill.Visible = msoFalse
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Word macro doesn't change font color Spideriffic Word VBA 8 11-04-2015 03:47 AM
Word 2010- help setting automatic font color Jazz43 Word 7 09-27-2012 10:59 PM
Codes for Word Textbox Font Color? Apply font color programatically using VBA Word divakarganta Word VBA 3 08-08-2012 08:05 PM
textbox color issue Dave Duncan Word 0 08-07-2011 10:38 AM
Codes for Word Textbox Font Color? Word 2007 Font Color Doesn't Work nnicko Word 2 04-16-2010 01:21 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:50 AM.


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