Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-24-2007, 03:55 AM
knut knut is offline
Novice
Redemption object and outlook
 
Join Date: Sep 2007
Posts: 1
knut
Default Redemption object and outlook

Hi All.



i have a problem with Redemption Objects .

i write a add in for outlook. this code must retrieve аll adresses from contact list.

i can get the Outlook OOM objects to work fine, but am having trouble
creating and using Redemption objects.
Here is my sample code to read a contact from the address book and
display the email address (bypassing the security prompt using
redemption):

what wrong?



Code:

void __stdcall CMyComAddIN::GetAdresses_Redemption()
{
    
    CoInitializeEx(NULL,COINIT_APARTMENTTHREADED);


    hr_pro_id = CLSIDFromProgID(L"Outlook.Application",&findCLSID);
    hr = olApp.CreateInstance(findCLSID);
    
    
    pFolder_ = olApp->GetNamespace(L"MAPI",&spNS);
    COleVariant covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR); 
    HRESULT log = spNS->Logon(covOptional, covOptional, covOptional, covOptional);
    spNS->GetDefaultFolder(Outlook::olFolderContacts,&spContacts); 


    
    
     spContacts->get_Items(&spItms);
     spItms->GetFirst(&spFirstItem);


    CLSID clsid; 
    CComPtr<Redemption::ISafeContactItem> pSafeContactItem(NULL); 

     hr_form_prog_id =  CLSIDFromProgID(L"Redemption.SafeContactItem", &clsid);
     hr_ = pSafeContactItem.CoCreateInstance(clsid);

        
    BSTR emailAddress;
    pSafeContactItem->put_Item(pContact_); 
    pSafeContactItem->get_Email1Address(&emailAddress);
    

    
    while(spFirstItem)
    {
        pContact_ = spFirstItem;
        CComBSTR emailAddress;
        
        pSafeContactItem->get_Email1Address(&emailAddress);
        spFirstItem.Release();
        spItms->GetNext(&spFirstItem);
    }

    
     spNS->Logoff(); 
     CoUninitialize();

     
}
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access Object library 10 Gyto Office 0 10-09-2008 09:04 AM
Publish custom contact form using Redemption Zakary Outlook 0 08-22-2008 07:40 AM
Object in SMTPSink looses Value jehemo2001 Outlook 0 03-14-2006 02:30 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:58 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft