vba with Word question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kate

    #1

    vba with Word question

    Can anyone tell me why the sub below changes the entire field result
    to 24 point text, but only changes the word "data" to blue ("new"
    remains black)?

    Public Sub change_text()

    Dim myRange As Range

    ActiveDocument. Variables("test ").Value = "new data"
    Set myRange = ActiveDocument. Fields(3).Resul t
    myRange.Font.Si ze = 24
    myRange.Font.Co lor = vbBlue
    ActiveDocument. Fields.Update

    End Sub
Working...