New mail windows doesn't go away with .Display Modal:=True 
Author Message
 New mail windows doesn't go away with .Display Modal:=True


In my program I create a new mail which the user should manually complete
and then send. This works great except that the new mail windows doesn't go
away. The user has to manually close it.

Btw, I have to use Modal because i'll do some testing afterwards...

Any clues what's wrong?

This is my code:

    Dim olApp As Outlook.Application
    Dim olMail As Outlook.MailItem
    Dim olRecipient As Outlook.Recipient

    Set olApp = CreateObject("Outlook.Application")
    Set olMail = olApp.CreateItem(olMailItem)
    Set olRecipient = olMail.Recipients.Add(strTo)
    olMail.Subject = strSubject
    olMail.HTMLBody = strBody
    olMail.Display Modal:=True

    Set olRecipient = Nothing
    Set olMail = Nothing
    Set olApp = Nothing

Cato Antonsen

Sun, 01 Aug 2004 18:30:29 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Sending an Outlook mail from my VBA-code doesn't close the mail windows

2. shdocvw ShellWindows doesn't work on modal IE windows

3. Code doesn't work when new mail arrives

4. Can't display non-modal window when modal window is displayed.

5. Access97-Confirmation won't go away!

6. Dereferencing objects don't go away

7. .ldb file won't go away

8. Excel won't go away

9. System Tray Menu Persists/Won't go away

10. Excel won't go away

11. Scripts don't go away...

12. ScriptControl.AddObject("Self",Me) - reference won't go away


Powered by phpBB® Forum Software