PC Review


Reply
Thread Tools Rate Thread

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

 
 
kradam
Guest
Posts: n/a
 
      18th May 2010
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
view.

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
 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      18th May 2010
Get the MailItem.PropertyAccessor object and use
PropertyAccessor.SetProperty("http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/81010003")
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.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"kradam" <(E-Mail Removed)> wrote in message
news:C809DC16-EDD9-456A-B963-(E-Mail Removed)...
>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
> view.
>
> 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


 
Reply With Quote
 
kradam
Guest
Posts: n/a
 
      27th May 2010
Thank you Ken, it was very helpful
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
In Outloook, allow an user to change the status of a task in remin =?Utf-8?B?QnJpYW4gSy4=?= Microsoft Outlook Discussion 1 1st Feb 2006 05:09 PM
how do I change the pop-up lists under my task status heading? =?Utf-8?B?RGVycmljaw==?= Microsoft Outlook Discussion 1 19th Jan 2006 11:17 PM
Format in task status report will not change =?Utf-8?B?SXZhbko=?= Microsoft Outlook Discussion 0 10th Jan 2006 02:30 PM
How do I change the status of mail in my Outbox? =?Utf-8?B?Sm9zZXBoIEouIENveA==?= Microsoft Outlook Discussion 0 10th Apr 2005 08:11 AM
Change task status request format =?Utf-8?B?TUVSaWNoYXJkcw==?= Microsoft Outlook Discussion 2 19th Mar 2005 05:11 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:03 AM.