main logo
Subject: RE: Automating Outlook Tasks & Contacts subfolders
Author: "Matthew Jarvis"
Posted: 2004/01/31 12:47:00
 
View Entire Thread
New Search


Like Allen said, it works the same as we were just discussing...

But here is a code example from my VFUG article (thanks to Ted Roche for the
idea of checking the "IPM.Contact"):


#include msoutl.h

oOutlook = createobject( "Outlook.Application")
oNameSpace = oOutlook.GetNameSpace("MAPI")
oContacts = oNameSpace.GetDefaultFolder( olFolderContacts )

* - get a reference to the sub-folder
oCBSContacts = oContacts.Folders("CBS")

oItems = oCBSContacts.Items
FOR m.i = 1 TO oItems.Count

* - Beware - your code will go BOOM if you try and get the data out of a
Contact List, so test for it first....
IF oItems.Item[m.i].MessageClass = "IPM.Contact"
oItem = oItems.Item[m.i]
? oItem.FullName, oItem.Email1Address
ELSE
? oItems.Item[m.i].MessageClass
ENDIF
NEXT



> -----Original Message-----
> From: profoxtech-bounces AT leafe D.OT com
> [mailto:profoxtech-bounces@leafe.com]On Behalf Of Roger Kuperways
> Sent: Saturday, January 31, 2004 6:50 AM
> To: profoxtech AT leafe D.OT com
> Subject: RE: Automating Outlook Tasks & Contacts subfolders
>
>
>
> Great Allen & Matthew,
>
> What about sub-folders for contacts?
>
> This only pull the main contact folder:
>
> oOutlook = CreateObject("Outlook.Application")
> oNameSpace = oOutlook.GetNameSpace("MAPI")
>
> * Get Contacts folder
> oContacts= oNameSpace.GetDefaultFolder( olContacts )
>
> * Go through contacts
> FOR EACH oContact IN oContacts.Items
> WITH oContact
> lcFirst = .FirstName
> lcLast = .LastName
>
> etc...
>
> <snip>



 
©2004 Matthew Jarvis
<-- Prior Message New Search Next Message -->