Parsing a Word Document using VBA

B

Bill Deibert

Hello,
I am using VBA from Access to interogate word documents. The documents have
a specific format but are edited using word - so users have full rights to
modify the document as they wish.

One portion of the document that I need to validate is data in a 3 column
table. Some columns are "gray" and some are "white". I am currently using the
..shading.texture, .shading.backgroundpatterncolor and
..shading.backgroundpatterncolorindex to determine if the cell is gray. Is
there an easy way to tell if a cell is gray (is not clear)?

The color of the cell will determine what action the program performs. Since
the data in the cell may not be correct, just parsing the cell is not a
guarantee of what action to take either.

Bill
 
D

Doug Robbins - Word MVP

If ActiveDocument.Tables(1).Cell(1, 1).Shading.BackgroundPatternColor =
wdColorGray10 Then
MsgBox "The Cell is shaded"
End If


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
Top