Setting flags on contact items

K

kara

Is there a way to set the Follow Up flag on contacts through vba? The
FlagRequest property is not valid on a ContactItem, although it is on a
MailItem; I could not find any 'flag' properties on Contact items, but assume
they must be there somewhere since flags can be set via the standard
interface.

For fun, I tried to use the code below which is successful in setting flags
for mail items in a selected folder, but the same code used with
'ContactItem' rather than 'MailItem' generates an error.

Dim myFolder as Outlook.MAPIFolder
Dim objItem as MailItem
For Each objItem In myFolder.Items
objItem.FlagRequest = "Follow Up"
objItem.Save
Next

What am I missing? Any help appreciated.
 
K

Ken Slovak - [MVP - Outlook]

Programming questions like this are best posted in a programming group such
as microsoft.public.outlook.program_vba.

What you're missing is first you're trying to access Contact items as Mail
items, which won't work at all. Second, you're trying to use a property on a
Contact item that doesn't exist on a Contact item.

You're correct that you can set flag (and reminder properties) on contact
items, but you can't use the Outlook object model to do it (except for
Outlook 2007, where those properties are exposed).

You would have to use a lower level API such as CDO 1.21, Extended MAPI (C++
or Delphi only) or Redemption (www.dimastr.com/redemption) to access those
properties and set them.

If you were to use Redemption you could set the FlagRequest property using
the DASL syntax for that property of "urn:schemas:httpmail:messageflag" and
a string value for the flag text you want.
 

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