Information générale
Catégorie:
COM/DCOM et OLE Automation
>>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.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement