# Insert a line of different colors of text into word via VBA



## aellington287 (Mar 15, 2016)

I am inserting text after a bookmark in word via VBA. I want the make the second part of the line be red. Is there a way to specify in code that only part of the inserted line needs to be a different color. My code is as follows:


```
wdapp.ActiveDocument.Bookmarks("txtbx3").Range.InsertAfter "1-A. D. E. = " & Cells(33, 19).Value
```

I want the value from cell(33,19) to come into word in red. How can I do that? Do I need to just create a second bookmark?

Thanks in advance!


----------



## Macropod (Mar 16, 2016)

You could use:

```
With wdapp.ActiveDocument.Bookmarks("txtbx3").Range
  .InsertAfter "1-A. D. E. = "
  .Collapse 0 'wdCollapseEnd
  .InsertAfter Cells(33, 19).Value
  .Font.ColorIndex = 6 'wdRed
End With
```


----------

