PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
MailItem Modal Display Issue - Window Does Not Close on Send
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
MailItem Modal Display Issue - Window Does Not Close on Send
![]() |
MailItem Modal Display Issue - Window Does Not Close on Send |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#3 |
|
Guest
Posts: n/a
|
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 "John Gregory" wrote: > 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.Application > Dim objMessage As Outlook.MailItem > Set objMessage = objOutlook.CreateItem(Outlook.OlItemType.olMailItem) > With objMessage > .To = "jgregory@midsouth.rr.com" > .Subject = "test" > .Body = "orange" > .Display (True) 'make it modal > End With > End Sub > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

