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

Read subject when New Mail arrives-Sub Folder



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 13th 06, 03:31 PM posted to microsoft.public.outlook.program_vba
Avadivelan TCS
external usenet poster
 
Posts: 8
Default Read subject when New Mail arrives-Sub Folder

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).U nRead = 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.

Ads
  #2  
Old November 13th 06, 04:38 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Read subject when New Mail arrives-Sub Folder

Answered at http://www.outlookcode.com/threads.a...essageid=20369

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

"Avadivelan TCS" wrote in message ...
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).U nRead = 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.

  #3  
Old November 14th 06, 02:31 AM posted to microsoft.public.outlook.program_vba
Avadivelan TCS
external usenet poster
 
Posts: 8
Default Read subject when New Mail arrives-Sub Folder

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.

"Sue Mosher [MVP-Outlook]" wrote:

Answered at http://www.outlookcode.com/threads.a...essageid=20369

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

"Avadivelan TCS" wrote in message ...
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).U nRead = 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.


  #4  
Old November 14th 06, 02:58 AM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Read subject when New Mail arrives-Sub Folder

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.

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

"Avadivelan TCS" wrote in message ...
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.

"Sue Mosher [MVP-Outlook]" wrote:

Answered at http://www.outlookcode.com/threads.a...essageid=20369



"Avadivelan TCS" wrote in message ...
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).U nRead = 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.


 




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
creating new mail subject folder in outlook express local folders heading themntneer Outlook Express 4 October 8th 06 02:41 AM
run a script when new mail arrives Shaun Outlook and VBA 0 August 24th 06 03:57 AM
Code to invoke a MessageBox when new mail arrives! RemySS Outlook and VBA 1 April 21st 06 06:38 AM
read mail folder list StupidDog Outlook - Using Forms 0 April 7th 06 10:32 AM
Move mail to a folder based on 2 different words in the subject fi Alan Kirkham Outlook and VBA 2 February 14th 06 03:34 PM


All times are GMT +1. The time now is 08:30 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.