I am adding a MACROBUTTON field using
ActiveDocument.Fields.Add Range:=rng, _
Type:=wdFieldEmpty, Text:= _
"MACROBUTTON LeftOffHere ""Doubleclick HERE to go to last edit"" ",
_
PreserveFormatting:=False

Can I format the visible text (Doubleclick HERE to go to last edit)? I
would like to highlight the text red, or at least turn the font color red.
So far, though, I've been unable to accomplish this using
Range.Font.HighlightColorIndex or Range.Font.ColorIndex. Am I trying to do
what isn't possible?

Ed

Re: Format MACROBUTTON field text? by Jean-Guy

Jean-Guy
Mon Jun 05 11:25:44 CDT 2006

Ed was telling us:
Ed nous racontait que :

> I am adding a MACROBUTTON field using
> ActiveDocument.Fields.Add Range:=rng, _
> Type:=wdFieldEmpty, Text:= _
> "MACROBUTTON LeftOffHere ""Doubleclick HERE to go to last
> edit"" ", _
> PreserveFormatting:=False
>
> Can I format the visible text (Doubleclick HERE to go to last edit)? I
> would like to highlight the text red, or at least turn the font
> color red. So far, though, I've been unable to accomplish this using
> Range.Font.HighlightColorIndex or Range.Font.ColorIndex. Am I trying
> to do what isn't possible?

Try something like this:

Dim rng As Range
Dim rngField As Range

Set rng = ActiveDocument.Paragraphs(1).Range
rng.Collapse wdCollapseStart

ActiveDocument.Fields.Add Range:=rng, _
Type:=wdFieldEmpty, Text:= _
"MACROBUTTON LeftOffHere ""Doubleclick HERE to go to last edit"" ", _
PreserveFormatting:=False

Set rngField = rng.Paragraphs(1).Range.Fields(1).Code
With rngField
.Font.Color = wdColorRed
End With

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org



Re: Format MACROBUTTON field text? by Ed

Ed
Mon Jun 05 11:51:50 CDT 2006

Beautiful!! Thank you!
Ed

"Jean-Guy Marcil" <NoSpam@LeaveMeAlone> wrote in message
news:eAgE3yLiGHA.5036@TK2MSFTNGP04.phx.gbl...
> Ed was telling us:
> Ed nous racontait que :
>
>> I am adding a MACROBUTTON field using
>> ActiveDocument.Fields.Add Range:=rng, _
>> Type:=wdFieldEmpty, Text:= _
>> "MACROBUTTON LeftOffHere ""Doubleclick HERE to go to last
>> edit"" ", _
>> PreserveFormatting:=False
>>
>> Can I format the visible text (Doubleclick HERE to go to last edit)? I
>> would like to highlight the text red, or at least turn the font
>> color red. So far, though, I've been unable to accomplish this using
>> Range.Font.HighlightColorIndex or Range.Font.ColorIndex. Am I trying
>> to do what isn't possible?
>
> Try something like this:
>
> Dim rng As Range
> Dim rngField As Range
>
> Set rng = ActiveDocument.Paragraphs(1).Range
> rng.Collapse wdCollapseStart
>
> ActiveDocument.Fields.Add Range:=rng, _
> Type:=wdFieldEmpty, Text:= _
> "MACROBUTTON LeftOffHere ""Doubleclick HERE to go to last edit"" ", _
> PreserveFormatting:=False
>
> Set rngField = rng.Paragraphs(1).Range.Fields(1).Code
> With rngField
> .Font.Color = wdColorRed
> End With
>
> --
> Salut!
> _______________________________________
> Jean-Guy Marcil - Word MVP
> jmarcilREMOVE@CAPSsympatico.caTHISTOO
> Word MVP site: http://www.word.mvps.org
>