Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / June 2005

Tip: Looking for answers? Try searching our database.

MailItem Modal Display Issue - Window Does Not Close on Send

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kkrellwi - 29 Jun 2005 14:48 GMT
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
John Gregory - 30 Jun 2005 01:47 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.