![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I've tried to set up a system wherein selected email automatically displays
but I've done something silly and it does not work. In short, I've declared an Outlook.Items object which is created at start up time and associated with a mailbox under the Inbox. An event handler for this mailbox has been added and it will display the email. I've also created a rule that moves selected emails into this mailbox. The idea is, email comes in, the rule places the email in the special box and the event handler gets triggered which displays the item. Good theory, bad practice. It doesn't work. Here's the VBA code: Private WithEvents ItemsAutoDisplay As Outlook.Items Private Sub Application_Startup() Set ItemsAutoDisplay = Application.Session.GetDefaultFolder(olFolderInbox ).Folders("SDG").Items End Sub Private Sub ItemsAutoDisplay_ItemAdd(ByVal Item As Object) If TypeOf Item Is Outlook.MailItem Then Item.Display End If End Sub -- Richard Lewis Haggard www.Haggard-And-Associates.com |
Ads |
#2
|
|||
|
|||
![]()
Richard Lewis Haggard HaggardAtWorldDotStdDotCom wrote:
Here's the VBA code: news://msnews.microsoft.com/microsof...ok.program_vba is the correct newsgroup for programming questions. -- Brian Tillman |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Configuring Inbox to allow incoming email only from selected peopl | ScoutMom | Outlook - Installation | 3 | August 15th 06 05:45 PM |
Adding a button when using word to display rtf messages fails | james | Add-ins for Outlook | 4 | August 13th 06 06:42 PM |
Rule to Forward Incoming Mail Fails when item is itself a replied-to or forwarded e-mail | Steven Bookman | Outlook - General Queries | 3 | April 6th 06 09:41 PM |
Automatically display incoming email | Richard Lewis Haggard | Outlook and VBA | 5 | February 21st 06 05:40 PM |
Cannot start Microsoft Outlook. Unable to display the selected fo | 5Circles | Outlook - Installation | 2 | January 19th 06 04:20 AM |