A
Avadivelan TCS
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.
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.