Hi Paul,
I ended up finding a "How To" KB article for mail merge
from VB that had enough code to let me do what I needed to
populate the table from VBA in Access.
Fine, but be warned: it's probably "nasty" macro-recorder
type code that 1. will be awfully slow in execution and 2.
won't optimally use Word's object model. Most of the "HowTo"
articles for automating Word contain absolutely abominable
code...
1) How do I turn off horizontal inside borders after the
first row, i.e., I want the column headings to be
separated by a horizontal line but not each of the cells
below? The HasHorizontal property seems to be read-only.
You need something along the lines of the following. Since I
don't know how your code looks, I can't tell you exactly how
to reference the table (row), but:
ActiveDocument.Tables(1).Rows(2).Borders.InsideLineStyle =
wdLineStyleNone
AND
ActiveDocument.Tables(1).Rows(2).Borders(wdBorderHorizontal).
LineStyle = wdLineStyleSingle
(Yes, borders are complicated!)
2) Outside the table, I was trying to turn on a gray
background for a little bit of text. It worked as I
expected by doing: wrdSelection.font.backgroundcolor =
wdColorgray05 followed by a typetext but a subsequent set
to wdColorWhite didn't reset it. The rest of my text
seemed to carry that background.
Mmmm. Well, you really should be using ranges, and not
selection, then you wouldn't have any problems with
"turning formatting off"... But the Word object model doesn't
have anything like font.backgroundcolor, so I don't know
where to start looking in order to help you? What do you
really have? How about copying/pasting that relevant section
of code?
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail
