Hi ?B?U2Ft?=,
Dim sWord As New Word.ApplicationClass
Dim sDoc As Word.Document
Dim sApp As Word.Application
Dim userOvertype As Boolean
'Start process of creating report document
sApp = sWord.Application
Why are you doing this? I should think this should be
enough:
dim sApp as New Word.Application
Beyond that, there's not much point in discussing your code
until you've looked at the article and tightened things up
a bit. Create a Table object and use that. As long as all
the cells in a row are formatted the same, apply formatting
to the Row.Range. Use a Range instead of the Selection
object where ever possible.
There's no need to process the table within a "With
currentSelection" structure.
You're mixing use of the application objects sWord and
sApp. This is probably not helping the situation; could
even be the cause of the problem. You should only have one
application object for the instance you're automating.
You should not need to release COM objects for things
you've never used directly. If you feel you must Release
sDoc, do so before setting the object variable (the
application) from which it was created to Nothing.
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jun 17 2005)
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
:-)