Outlook security dialog hides behind other windows

C

Cooz

Hi everyone,

In one of our templates an email message is generated by means of code:

....
Set oOApp = CreateObject("Outlook.Application")
Set oOMail = oOApp.CreateItem(olMailItem)
With oOMail
.To = Email
.Subject = "Aanvraagformulier " & docNaam & ".doc"
.Body = ""
.Attachments.Add ActiveDocument.Path & "\" & ActiveDocument
.Send
End With
....

Works fine. When this code executes, the Outlook security dialog pops up as
expected ("A program is trying to automatically send e-mail on your
behalf...") - which is OK. Users are willing to supply one more click.

However, what bothers them, and me, is that this dialog sometimes disappears
behind other windows. The flashing icon on the taskbar that activates the
dialog is easily overlooked - especially with users who have their taskbar
automatically hidden - and Word seems to have stopped responding. This
behavior seems to occur more often when the above code is run more than once
with the same document.

Is there a way to ensure - by means of VBA or otherwise - that this dialog
always appears on top of other windows? Perhaps it is possible to minimize
all open windows before it shows up and restoring them afterwards... - but I
don't know how. Can someone help me out here?

Thank you,
Cooz

(Windows XP, Word 2003, English version)
 
A

Astrid

Hi Cooz,

I can't reproduce this problem. Were you able to pinpoint the exact
circumstaince when the dialog is behind the window?
Otherwise, could it be an idea to let the users press the send button
themselves and use .Display instead of .Send which should activate the email
on showing?

Kind regards,
Astrid
 
C

Cooz

Hi Astrid,

Of course! Letting the users press the Send button is a Very Acceptable
workaround. I should have thought of this myself, but, well, didn't.
Thank you.

Kind regards,
Cooz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top