Quantcast
Channel: Word for Developers forum
Viewing all articles
Browse latest Browse all 4350

How do you change the font color of text in a Word document table using Visual Studio 2010?

$
0
0

I'm trying to figure out how to change the font color of text in a Word document table using Visual Basic, but I can't seem to figure out the correct syntax. This is what I currently have in my code:

Dim rngCell As Word.Range
rngCell = tbl.Cell(1, 1).Range
tbl.Cell(1, 1).Range.Text = "1.  ACCOUNT CREATION"
tbl.Cell(1, 1).Range.Font.Size = 18
tbl.Cell(1, 1).Range.Font.Bold = vbYes
tbl.Cell(1, 1).Range.Font.ColorIndex = wdBlack

The last line of code containing "wdBlack" has a syntax error.  Does anyone know what the correct syntax should be in order to change the color of the text in this table cell to black? 

Thanks in advance,

Jim


James Hutchinson


Viewing all articles
Browse latest Browse all 4350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>