I am opening Word from another application through a macro where I do a lot
of manipulation in the file and then I show it in print preview.
I don't want the user to see the file until it's ready to be shown in print
preview. I immediately make the window minimized and application invisible
but there is still this slight period where the user sees the open file.
What's the best way to control this?
Howard Kaikow - 27 Jun 2005 22:41 GMT
use the range object instead of the selection object, and make sure that the
macro is doing its thing in a non-visible instance of word.
if word is made non-visible, there's no need to minimize.
as a last resort, use api calls to temporarily lock the keyboard and mouse
so the user cannot access the doc.

Signature
http://www.standards.com/; See Howard Kaikow's web site.
> I am opening Word from another application through a macro where I do a lot
> of manipulation in the file and then I show it in print preview.
[quoted text clipped - 3 lines]
> but there is still this slight period where the user sees the open file.
> What's the best way to control this?
Ian B - 29 Jun 2005 06:35 GMT
Be aware of some "gotcha's" with app invisible.
Microsoft acknowledge some difficulties with Selection.MoveUp and
Selection.MoveDown
Symptom will be Word freezes 100% CPU utilisation.
See link below
http://www.kbalertz.com/kb_235876.aspx
HTH
Ian B
> I am opening Word from another application through a macro where I do a lot
> of manipulation in the file and then I show it in print preview.
[quoted text clipped - 3 lines]
> but there is still this slight period where the user sees the open file.
> What's the best way to control this?
Howard Kaikow - 29 Jun 2005 22:28 GMT
> Be aware of some "gotcha's" with app invisible.
> Microsoft acknowledge some difficulties with Selection.MoveUp and
> Selection.MoveDown
> Symptom will be Word freezes 100% CPU utilisation.
> See link below
> http://www.kbalertz.com/kb_235876.aspx
That's why I suggested using the Range object.
Use the Selection object only when absolutely necessary.