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 / November 2006

Tip: Looking for answers? Try searching our database.

Read subject when New Mail arrives-Sub Folder

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Avadivelan TCS - 13 Nov 2006 14:31 GMT
Hi All ,Good Morning,When i use the below code to read "subject" from my
INBOX.Its working good.
If i want to read the subject in the Sub folders means,i get the bellow error:
"Run -time error'2147221233(8004010f)';
The operation failed.An object could not be found"

Code is:

Private Sub Application_NewMail()
   
   Dim InputFolder As Outlook.MAPIFolder
   Set InputFolder =
Application.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)
   Dim intCount As Integer
   
   For intCount = 1 To InputFolder.Items.Count
       'If InputFolder.Items(intCount).UnRead = True Then 'Read out the
unread mail in Inbox.
       
       If Application.GetNamespace("MAPI").Folders("Mailbox - Mailbox -
Valivelan Adhimoolam").Folders("karthick").Items(intCount).UnRead = True Then
           
           MsgBox InputFolder.Items(intCount).Subject
           MsgBox InputFolder.Items(intCount).Body
           InputFolder.Items(intCount).UnRead = False
       End If
   Next intCount
   

End Sub

Thanks in advance for your reeply.
Sue Mosher [MVP-Outlook] - 13 Nov 2006 15:38 GMT
Answered at http://www.outlookcode.com/threads.aspx?forumid=2&messageid=20369

Signature

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
 

> Hi All ,Good Morning,When i use the below code to read "subject" from my
> INBOX.Its working good.
[quoted text clipped - 28 lines]
>
> Thanks in advance for your reeply.
Avadivelan TCS - 14 Nov 2006 01:31 GMT
Hi Sue Mosher,
Good Morning, I am new to Outlook macro. I am not able to understand your
reply. can you help me in the coding level?
Have a nice day.

Thanks in advance for your reply.

> Answered at http://www.outlookcode.com/threads.aspx?forumid=2&messageid=20369
>
[quoted text clipped - 30 lines]
> >
> > Thanks in advance for your reeply.
Sue Mosher [MVP-Outlook] - 14 Nov 2006 01:58 GMT
If you respond in the other thread where I've already responded and point out just what it is you don't understand, I'll be happy to try to help you. But please read my response first and take a look at the variable that I pointed out as the problem.

Signature

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
 

> Hi Sue Mosher,
> Good Morning, I am new to Outlook macro. I am not able to understand your
[quoted text clipped - 4 lines]
>
>> Answered at http://www.outlookcode.com/threads.aspx?forumid=2&messageid=20369

>>    
>> > Hi All ,Good Morning,When i use the below code to read "subject" from my
[quoted text clipped - 29 lines]
>> >
>> > Thanks in advance for your reeply.
 
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.