A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - General Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Auto display of selected incoming email fails



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old October 13th 06, 06:36 PM posted to microsoft.public.outlook
Richard Lewis Haggard
external usenet poster
 
Posts: 14
Default Auto display of selected incoming email fails

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


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 05:16 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.