B
Blackberry
Hi All
Developing a VB6 app that writes text and a bit of formatting to a table in
a MS Word template doc via VBA.
I can change the text colour, bold, italic and underline params fine on my
text, but I can't get the background colour of my text to change.
Formatting the bg colour for a whole cell in a table is no good to me and
I've just found that the paragraph format is also no good, as I need to
format the bg colour of text on a line by line basis. For example cell 1
might look like the following:
Fred Bloggs < bg colour needs to be blue
Bilbo Bloggs <bg colour needs to be untouched, ie white
Barry Bloggs <bg colour needs to be red
etc
Move onto next cell.
The code that I am currently using is:
oNewDoc.Tables(1).Cell(intRow,
intCol).Range.Paragraphs(intLine).Range.ParagraphFormat.Shading.BackgroundPatternColor
= wdColorRed
Which doesn't really work because if cell 1 has 2 names in it then cell 4
with one name has 2 lines of the same colour. I need 1 line of colour that
covers just the name.
I've noticed that the highlight option might do it, but you appear to be
limited to 15 or so colours (with most being too dark). Am I wrong?
I'd prefer some form of TextFormat.Shading etc format as it opens the
colours up for me, but there doesn't seem to be an option.
Note I have to work with Office 2000/2003 users.
Thanks
Developing a VB6 app that writes text and a bit of formatting to a table in
a MS Word template doc via VBA.
I can change the text colour, bold, italic and underline params fine on my
text, but I can't get the background colour of my text to change.
Formatting the bg colour for a whole cell in a table is no good to me and
I've just found that the paragraph format is also no good, as I need to
format the bg colour of text on a line by line basis. For example cell 1
might look like the following:
Fred Bloggs < bg colour needs to be blue
Bilbo Bloggs <bg colour needs to be untouched, ie white
Barry Bloggs <bg colour needs to be red
etc
Move onto next cell.
The code that I am currently using is:
oNewDoc.Tables(1).Cell(intRow,
intCol).Range.Paragraphs(intLine).Range.ParagraphFormat.Shading.BackgroundPatternColor
= wdColorRed
Which doesn't really work because if cell 1 has 2 names in it then cell 4
with one name has 2 lines of the same colour. I need 1 line of colour that
covers just the name.
I've noticed that the highlight option might do it, but you appear to be
limited to 15 or so colours (with most being too dark). Am I wrong?
I'd prefer some form of TextFormat.Shading etc format as it opens the
colours up for me, but there doesn't seem to be an option.
Note I have to work with Office 2000/2003 users.
Thanks