Using the code below to create an email and bring up the email display pane.
When I click on send the email window does not close. If I set .Display
false it works fine. Is there a way to fix this issue as I need to have a
modal window.
Dim objOutlook As New Outlook.Application
Dim objMessage As Outlook._MailItem
objMessage = objOutlook.CreateItem(Outlook.OlItemType.olMailItem)
With objMessage
.To = "<email address>"
.Subject = "test"
.Body = "orange"
.Display(True) 'make it modal
End With
I made two slight changes and it tested fine on my OL2K
(1) I added Set before ojbMessage
(2) I did not use <> in the email address
Sub SendMailNotModal(
Dim objOutlook As New Outlook.Applicatio
Dim objMessage As Outlook.MailIte
Set objMessage = objOutlook.CreateItem(Outlook.OlItemType.olMailItem
With objMessag
.To = "jgregory@midsouth.rr.com
.Subject = "test
.Body = "orange
.Display (True) 'make it moda
End Wit
End Su
kkrellwi - 30 Jun 2005 13:34 GMT
Thanks for the reply, but the original code worked until the upgrade to
Office 2003. on your 2nd change the <> where just place holders. I figured
out a work around
instead of using
.Display (True) 'make it modal
I used the following:
Set ins = .GetInspector
ins.Display True
ins.Close (olDiscard)
Seems to work fine now
> I made two slight changes and it tested fine on my OL2K.
> (1) I added Set before ojbMessage =
[quoted text clipped - 11 lines]
> End With
> End Sub