Adding follow flag for me by macro (MSO2007)

  • Thread starter SmFyZGEgTC4
  • Start date Views 3,294
Status
Not open for further replies.
S

SmFyZGEgTC4

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

Sue Mosher

"Jarda L." <JardaL> wrote in message

news:7F80F1C3-A1C4-4383-8125-FF371E0002A2@microsoft.com...
> 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

SmFyZGEgTC4

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.

"Sue Mosher [MVP]" wrote:


> 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
> > Sue Mosher
> > >

> "Jarda L." <JardaL> wrote in message
> news:7F80F1C3-A1C4-4383-8125-FF371E0002A2@microsoft.com...
> > 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]

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

"Jarda L." <JardaL> wrote in message

news:38EAA83A-DFA7-4C61-BE35-7AC4E9464AC7@microsoft.com...
> 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.

> "Sue Mosher [MVP]" wrote:
>
> > 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
>

>> "Jarda L." <JardaL> wrote in message
> > news:7F80F1C3-A1C4-4383-8125-FF371E0002A2@microsoft.com...
> > > 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

>

>
>>
 
Status
Not open for further replies.
Top