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 and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Failure to display an email item



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 13th 06, 11:34 PM posted to microsoft.public.outlook.program_vba
Richard Lewis Haggard
external usenet poster
 
Posts: 14
Default Failure to display an email item

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
has been added that is supposed to be invoked when an email is added to
the mail box 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  
Old October 13th 06, 11:46 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Failure to display an email item

You mean "folder" not "mailbox," right?

Does any VBA code run? Did you check the basics at http://www.outlookcode.com/d/vbabasics.htm

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Richard Lewis Haggard" HaggardAtWorldDotStdDotCom wrote in message ...
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
has been added that is supposed to be invoked when an email is added to
the mail box 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


  #3  
Old October 17th 06, 04:00 PM posted to microsoft.public.outlook.program_vba
Richard Lewis Haggard
external usenet poster
 
Posts: 14
Default Failure to display an email item

Yes, my VBA code that creates a new signature after each email is sent seems
to execute normally so it is not a permissions failure or a failure to
enable macros problem. I'm wondering if I might have declared the variable
in the wrong place (VBA for Outlook is not my primary programming
environment).
--
Richard Lewis Haggard
www.Haggard-And-Associates.com
"Sue Mosher [MVP-Outlook]" wrote in message
...
You mean "folder" not "mailbox," right?

Does any VBA code run? Did you check the basics at
http://www.outlookcode.com/d/vbabasics.htm

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Richard Lewis Haggard" HaggardAtWorldDotStdDotCom wrote in message
...
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
has been added that is supposed to be invoked when an email is added to
the mail box 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



 




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
Update failure for Outlook 2003 Junk Email Filter (KB916521). GeekyDave Outlook - Installation 0 May 26th 06 09:28 AM
How do I display item start times? JessChamp Outlook - Calandaring 0 May 3rd 06 12:16 AM
Display Contact's age in recurring Calendar item jct38 Outlook - Using Contacts 1 April 20th 06 04:40 AM
In Contacts, display email addresses last, first (email address) kmiller11 Outlook - Using Contacts 1 March 24th 06 11:12 PM
Exception at item display Yury Kudryashov Add-ins for Outlook 0 March 13th 06 07:12 PM


All times are GMT +1. The time now is 08:57 PM.


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.