Text formatting with gotobutton

F

frogman

This code does what I want it to except one thing:
When you click the field and start typing I want the text to change to
black.
The field looks like this
[One list]
the [] are not part of the field, they are demarkators for the user to
know this is an option in the text. They are also bold and red.

When the user types over the field it is red bold text and i want it to
be normal black text.




With myRng
.Delete
.Collapse wdCollapseEnd
.Fields.Add Range:=myRng, Type:=wdFieldEmpty, Text:="GOTOBUTTON
" & strBookMarkName & " ", PreserveFormatting:=False
.Move Unit:=wdWord, count:=5
.Fields.Add Range:=myRng, Type:=wdFieldQuote,
PreserveFormatting:=False
.Move Unit:=wdWord, count:=2
.InsertAfter ("""" & strSelection & """ \* CharFormat")
.Move Unit:=wdWord, count:=2
If blnLastRowOfTable = False And blnInTable = False Then
.InsertAfter vbCr
End If
End With


'finds and changes the Q to red and updates the fields
With Selection
.Font.Color = wdColorAutomatic
.Font.Bold = False
.Font.Italic = False
.find.ClearFormatting
.find.Forward = False
.find.MatchCase = True
.find.Text = "Q"
.find.Execute
.Font.Color = wdColorRed
.Font.Italic = True
.Fields.Update

End With
 
F

frogman

What I did was to put a space with the format I wanted the field to
change to in front of the the field and that worked like a charm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top