R
Ryan Hubbard
I'm attempting to set the MessageClass of a MailItem but I get the
following error.
"Method 'MessageClass' of object 'MailItem' faild"
I also am trying to set the MailItem to a MailItem Object and I get a
TypeMismatch, but I am testing to make sure it is a MailItem first.
Can someone help me out?
Set myOlApp = CreateObject("Outlook.Application")
Set objInboxItems =
myOlApp.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Items
Dim objMail As MailItem
If objInboxItems.Count > 1 Then
For I = 1 To objInboxItems.Count Step 1
If TypeName(objInboxItems.Item(I)) = "MailItem" Then
' This next line gives me the Method failed
objInboxItems.Item(I).MessageClass = "IPM.Test"
' This next line gives me a type mismatch
Set objMail = objInboxItems.Item(I).
End If
Next
End If
following error.
"Method 'MessageClass' of object 'MailItem' faild"
I also am trying to set the MailItem to a MailItem Object and I get a
TypeMismatch, but I am testing to make sure it is a MailItem first.
Can someone help me out?
Set myOlApp = CreateObject("Outlook.Application")
Set objInboxItems =
myOlApp.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Items
Dim objMail As MailItem
If objInboxItems.Count > 1 Then
For I = 1 To objInboxItems.Count Step 1
If TypeName(objInboxItems.Item(I)) = "MailItem" Then
' This next line gives me the Method failed
objInboxItems.Item(I).MessageClass = "IPM.Test"
' This next line gives me a type mismatch
Set objMail = objInboxItems.Item(I).
End If
Next
End If