setting status flag programmatically

  • Thread starter Thread starter Dasha
  • Start date Start date
D

Dasha

Hi, I have following problem:
I use Outlook 2003, I create items based on the custom form
(Form.Post) in a public folder. Can I set a flag or colour for it
programmatically
depending on the specified field value? As far as I know, there's a
way to set flags for email messages that will be sent with a message.
But
is there a way to set such flag for a saved form in a public folder?
Is it possible?

Thanks
 
You can set flags on Post items, which is what I think you're talking about
(derived from IPM.Post). You do it the same way you'd set flags on email
items (IPM.Note).
 
I tried
Item.FlagStatus = olFlagMarked,
but there is an error that there is no such property. But it is the
only way I found. Is it wrong?
 
FlagStatus property is only exposed by the MailItem and MeetingItem objects.
PostItem object does not expose it.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Not in OOM - Extended MAPI (C++/Delphi only) or CDO 1.21 or Redemption.
One possible workaround in OOM would be to reset the MessageClass property
to IPM.Note, remember the entry id, reset the variable that holds PostItem
to Nothing, pray that nothing else (including Outlook) holds a reference to
the same obejct, reopen it using Namespace.GetItemfromID (it will return
MailItem since the message class was changed to IPM.Note), set the
FlagStatus property, reset message class back to IPM.Post, save it.
Your prays do not work and there is still an outstanding reference to the
same post item, Namespace.GetItemfromID will return the cached PostItem
object rather than MailItem.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Right. You can set a flag in the UI for a Post item but to set it in code
you would have to use CDO 1.21 or Extended MAPI or Redemption.
 
Back
Top