Adding follow flag for me by macro (MSO2007)

J

Jarda L.

I'd like to create a button which add follow up flag for me, not for
recipient (in new mail). How to do it? Manually I am able to add flag for me
by using Custom flag dialog. I use Outlook 2007.

Please help me edit undermentioned lines of macro, I couldn't find
properties for Flag for me. Macro creates flag for recipient.

Sub AddFlag()
Set objOL = CreateObject("Outlook.Application")
objOL.ActiveInspector.CurrentItem.Categories = "Wait or..."
objOL.ActiveInspector.CurrentItem.FlagStatus = olFlagMarked
objOL.ActiveInspector.CurrentItem.FlagRequest = "Wait For.."
objOL.ActiveInspector.CurrentItem.FlagDueBy = Now() + 7
objOL.ActiveInspector.CurrentItem.FlagIcon = 6

End Sub

Thanks a lot.
Jarda
 
S

Sue Mosher [MVP]

Take a look at the MarkAsTask method and TaskDueDate property:

Set Message = Application.ActiveInspector.CurrentItem
With Message
.MarkAsTask olMarkThisWeek
.TaskDueDate = #3/24/2009#
.TaskSubject = "Follow up with " & Message.SenderName
.ReminderSet = True
.ReminderTime = #3/18/2009 8:30:00 AM#
.Save
End With
 
J

Jarda L.

Thank you for suggestion. Macro works well with sent or received items. But
not with new message or concepts what is my goal.

Run-time error '-2147467263 (80004001) -
Property .MarkAsTask is suported on sent or received items.

Jarda L.
 
S

Sue Mosher [MVP]

Sorry, I missed the part about this being a new message. I think what you'll
have to do is monitor the Sent Items folder for new items using the
Folder.Items.ItemAdd event and use the method and properties I suggested on
the sent item. I think Outlook itself keeps the flag information in memory
for draft items and doesn't write the information to the item until after
it's delivered to the outbound server.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 

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

Top