M
Michael
Hi
I need to export all Contacts from a specified folder.
It works all fine, but if i put a Distribution list into the folder,
my programm crashes. I tryed the following but it didnt work:
_ItemsPtr pItems = pFolder->get_Items();
_ContactItemPtr pContact;
//Count the Items
long lContactCount = pItems->Count;
//get first contact
pContact = pItems->GetFirst();
for(long i = 1; i <= lContactCount; i++){
if(i != 1){
pContact = pItems->GetNext();
}
if(pContact->get_Class() == olContact){
AnsiString sTemp;
sTemp = pContact->get_FullName();
//Display the item in a Message Box (only for testing)
Application->MessageBoxA(sTemp.c_str(),"Contact",MB_OK);
}
}
I'm working with C++ Builder from Borland.
Can anybody help me?
I need to export all Contacts from a specified folder.
It works all fine, but if i put a Distribution list into the folder,
my programm crashes. I tryed the following but it didnt work:
_ItemsPtr pItems = pFolder->get_Items();
_ContactItemPtr pContact;
//Count the Items
long lContactCount = pItems->Count;
//get first contact
pContact = pItems->GetFirst();
for(long i = 1; i <= lContactCount; i++){
if(i != 1){
pContact = pItems->GetNext();
}
if(pContact->get_Class() == olContact){
AnsiString sTemp;
sTemp = pContact->get_FullName();
//Display the item in a Message Box (only for testing)
Application->MessageBoxA(sTemp.c_str(),"Contact",MB_OK);
}
}
I'm working with C++ Builder from Borland.
Can anybody help me?