Formatting text in a word document

G

Guy Cohen

Hi all.

Is it possible to :

a. Change text in a table to have a specific font name/color.
b. Change font/color of a docVariable

If yes - please provide some code.

TIA
Guy
 
J

Jean-Guy Marcil

Hi Guy,

Selection.Font.Name = "Arial"
Selection.Font.Color = wdColorRed
???

Or did you have something else in mind?

--
Cheers!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
J

Jean-Guy Marcil

Dim wdApp As Word.Application
Set wdApp = CreateObject("Word.Application")
..
..
..
..
wdApp.Selection.Font.Name = "Arial"
wdApp.Selection.Font.Color = wdColorRed
???


--
Cheers!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
J

Jezebel

You can apply font and color (and all other formatting) instructions to any
range.

ActiveDocument.Tables(1).Cell(1,1).Range.Font.Name = "Arial"

etc.

You can use this same method for any field range. (Assuming that's what you
mean by DocVariables).
 

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