Home All Groups Group Topic Archive Search About
Author
6 Mar 2006 3:19 PM
Ken K
Is there any way to prevent users from switching between documents in Word
when a VB form is showing?

I’ve got a COM add-in that opens a form modally, but that doesn’t prevent
users from switching to different documents (using the Windows task bar for
instance) while the form is open.  Is there any way to “lock” all Word
windows while a form is open to prevent users from switching between
documents while the modal form is open?

I’ve seen various “keep on top” solutions in google groups but as far as I
can tell they don’t really prevent users from switching documents, they just
seem to keep the form on top.

Any help greatly appreciated!  If this question should be posted to a
different newsgroup please let me know.  Thanks...

Author
8 Mar 2006 10:58 AM
Jan Hyde
Ken K <K***@discussions.microsoft.com>'s wild thoughts were
released on Mon, 6 Mar 2006 07:19:31 -0800 bearing the
following fruit:

Show quoteHide quote
>Is there any way to prevent users from switching between documents in Word
>when a VB form is showing?
>
>I’ve got a COM add-in that opens a form modally, but that doesn’t prevent
>users from switching to different documents (using the Windows task bar for
>instance) while the form is open.  Is there any way to “lock” all Word
>windows while a form is open to prevent users from switching between
>documents while the modal form is open?
>
>I’ve seen various “keep on top” solutions in google groups but as far as I
>can tell they don’t really prevent users from switching documents, they just
>seem to keep the form on top.
>
>Any help greatly appreciated!  If this question should be posted to a
>different newsgroup please let me know.  Thanks...

It's a pretty user unfriendly thing to do. The question is
why do you want to prevent them?

My guess is that your using the active document in code? If
so then the best solution is to reference the actual
document your working with and let the user swich documents
to their heart content.



Jan Hyde (VB MVP)

--
Man with hole in pocket feel cocky all day.
Author
9 Mar 2006 4:08 AM
NickHK
Ken,
Using a normal modal userform or a modal Word form (e.g. SaveAs)  prevents
user changing documents that are in the same instance of Word.
If the document is in a difference instance of Word, then naturally the
normal modal behaviour does not occur.
Not 100% sure if this applies to COM addins also, but is this your situation
?

NickHK

Show quoteHide quote
"Ken K" <K***@discussions.microsoft.com> wrote in message
news:5A24844B-620B-4B6B-8BF2-CB719BD1BDD5@microsoft.com...
> Is there any way to prevent users from switching between documents in Word
> when a VB form is showing?
>
> I've got a COM add-in that opens a form modally, but that doesn't prevent
> users from switching to different documents (using the Windows task bar
for
> instance) while the form is open.  Is there any way to "lock" all Word
> windows while a form is open to prevent users from switching between
> documents while the modal form is open?
>
> I've seen various "keep on top" solutions in google groups but as far as I
> can tell they don't really prevent users from switching documents, they
just
> seem to keep the form on top.
>
> Any help greatly appreciated!  If this question should be posted to a
> different newsgroup please let me know.  Thanks...
>