Hi Mike
You generally get a performance gain from running word with .Visible =
False.
If you want to run with .Visible = False and not .Activate-d, then the code
itself should be written so that it will do exactly the same thing whether
or not Word is .Visible or .Activate-d.
I would suspect two likely problems with the code.
First, ensure that the code is always referring to the correct Document. For
example, don't rely on references to Word's ActiveDocument. Create a
reference to the Target Document, and use that reference consistently.
Second, don't use the .Selection. Instead, set a reference to a range, and
use that.
Hope this helps.
Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
> Am working with an executable that invokes Word and preprocesses a Target
> Document, I have noticed that if I don't set the objWord (application
[quoted text clipped - 14 lines]
>
> Is there a best practices for performance approach?
mike - 27 Nov 2006 16:26 GMT
Thank you Shauna,
I researched the usage of ActiveDocument and it looks like the original
author did implement the reference like you mentioned.
I ended up with...
With objWord
.Visible = True
.Activate
.Visible = False
End With
Am getting the performance and consistency.
I will look at the Range and Selection implementations as you also
mentioned.
Thanks again, sincerely, - Mike
> Hi Mike
>
[quoted text clipped - 37 lines]
>>
>> Is there a best practices for performance approach?