How to change status of a mail marked as a task (VBA)



I like Outlook feature of combining tasks and marked as task emails in a
single task view. I can change status of tasks and THESE EMAILS in a table

If I send an email and I flag it then it means for me that the status of
this Task should be set to olTaskWaiting. I do it manualy in a task view but
I decided to create a code snippet to change the status automatically.

I catch ItemAdd event in SentMail folder:

Private Sub myOlItems_ItemAdd(ByVal Item As Object)
If Item.FlagStatus = olFlagMarked Then
Item.Status = olTaskWaiting ' ERROR!
End If
End Sub

When I send a marked email I get an error message" "Object doesn't support
this property or method.". It isn't actually suprising cause MailItem object
doesn't support Status property. How could I change Status of my marked as
tasks emails using VBA?

Outlook 2007, WIN 7

Ken Slovak - [MVP - Outlook]

Get the MailItem.PropertyAccessor object and use
to set the value you want, which would be a Long.

Note that the property tag value supplied for Status is a DASL property tag
string and not an URL.

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question