Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding New Contact in Outlook
Message
From
05/09/2001 15:55:27
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00552487
Message ID:
00552770
Views:
39
>>I have a custom folder in Outlook Contact Folder and need to add contacts from
>>this custom folder to a distribution lists through vfp 6.0...
>>A problem I have ran into is that Outlook can not see any contacts in this
>>custom folder. Any ideas? Eric
>
>Can you show your code on where and how you reference the Custom Folder under Contacts?

oOL = CREATEOBJECT("Outlook.Application")

if isnull(oOl) or vartype(oOL) <> 'O'
messagebox('Unable to open Outlook, goodbye!', 16, 'Add Outlook Distribution list')
clear all
return
endif
oNameSpace = oOl.GetNameSpace("MAPI")
oContacts = oNamespace.GetDefaultFolder(10)

loContact = oContacts.folders.Add("New Dist Lists")

mytemp = locontact.Items.Add(0) && mail item
myDist = loContact.Items.Add(7) && distribution list item
myDist.DLName = "New Sub List"
myRecipients = myTemp.Recipients
SELE USERS
scan
myRecipients.Add(allt(userid))
endscan
myDist.AddMembers(myRecipients)
mydist.save

* create entire new list
mytemp = loContact.Items.Add(0) && mail item
myDist = loContact.Items.Add(7) && distribution list item
myDist.DLName = "New Main List"
myRecipients = myTemp.Recipients
myRecipients.Add("New Sub List")
myDist.AddMembers(myRecipients)
mydist.save

My "New Sub List" is created fine, but the "New Main List" contains nothing.

If I run this code and do not use the folder to save the distribution lists
everything works fine.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform