A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Contacts
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Setting flags on contact items



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 12th 07, 10:52 PM posted to microsoft.public.outlook.contacts
kara
external usenet poster
 
Posts: 11
Default Setting flags on contact items

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.

  #2  
Old January 15th 07, 02:53 PM posted to microsoft.public.outlook.contacts
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Setting flags on contact items

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.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"kara" wrote in message
...
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.


  #3  
Old January 15th 07, 05:55 PM posted to microsoft.public.outlook.contacts
kara
external usenet poster
 
Posts: 11
Default Setting flags on contact items

Sorry for the ambiguity...the actual code I attempted to use for accessing
CONTACT items is shown below and works for various properties, just not flags
and reminders.

Thanks for your response; I will look into the possibility of using CDO and
post any follow-up questions to an appropriate programming newsgroup.

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


"Ken Slovak - [MVP - Outlook]" wrote:

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.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"kara" wrote in message
...
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.



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
setting up contact management Henk Jan Outlook - Using Contacts 1 January 9th 07 10:01 PM
Setting up Outlook Contact so that they can be used to mail merge Terry Clark Outlook - Using Contacts 2 December 5th 06 09:00 PM
How do I set conditional flags based on last contact TOLAR Outlook - Using Contacts 0 September 30th 06 01:10 PM
setting up customised contact address lists alioopoop1 Outlook - Using Contacts 2 June 7th 06 12:46 AM
Setting Read Receipts on a per-contact basis? Gordon Outlook - General Queries 2 March 8th 06 03:17 PM


All times are GMT +1. The time now is 05:10 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.