Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Add-Ins / February 2004

Tip: Looking for answers? Try searching our database.

Hidden-Folder-Items with Redemption with VC++

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sven Ilius - 20 Feb 2004 07:31 GMT
Hallo,

i try to write a new hidden item with redemption. But i get only an
empty new item, there are no propertys filled.
As you can see in my testcode. The first time the code runs, i create
a hidden-item. if i run the code again, i check the hidden items and
find also my item, but this has empty propertys.

any ideas ?

Sorry for my english
Sven Ilius

   CComPtr<Redemption::ISafeMAPIFolder> sFldr;
   CLSID clsid;
    HRESULT hr;
    if ((hr = ::CLSIDFromProgID(L"MySafeDll.MyMAPIFolder",
            &clsid)) != NOERROR)
   {
       ATLTRACE("\nFailed get ISafeMAPIFolder from Redemption");
   }
   if ((hr = ::CoCreateInstance(clsid, NULL,
          CLSCTX_INPROC_SERVER, __uuidof(ISafeMAPIFolder), (void**)
              &sFldr)) != S_OK)
   {
       ATLTRACE("\nFailed get ISafeMAPIFolder from Redemption");
   }
    else
    {
        CComPtr<Outlook::MAPIFolder> fldr;

        if( ns->GetDefaultFolder(olFolderInbox,&fldr)==S_OK);
        {
        hr = sFldr->put_Item(fldr);
        CComPtr<Redemption::ISafeItems> hiddenitems;
        sFldr->get_HiddenItems(&hiddenitems);
        CComPtr<Redemption::IMessageItem>  hmessage;
        long count;
                hiddenitems->get_Count(&count);
        BSTR subj,body;
        for(long i=0;i<count;i++)
        {
            hiddenitems->Item(CComVariant(i),&hmessage);
            BSTR messclass;
            hmessage->get_MessageClass(&messclass);
            if(hmessage->get_Subject(&subj)==S_OK)
            {
                          if(subj == NULL)
                          {
                               // if it goes to this, the Sybject -
property   is empty, but i have written it, below
                hmessage->Delete();
                          }
              else
                  SysFreeString(subj);

            }
            hmessage = NULL;
        }

         hr =hiddenitems->get_Count(&count);
         hr =hiddenitems->Add(CComVariant(L"IPM.Note"),&hmessage);
          hr =hmessage->put_Subject(L"TEST");
          hr =hmessage->Save();
         hmessage = NULL;

        hiddenitems = NULL;
        }

        fldr = NULL;
    }

    sFldr = NULL;
Dmitry Streblechenko \(MVP\) - 20 Feb 2004 16:46 GMT
Can you see the message and its properties using OutlookSpy (click
IMAPIFolder, go to the Associated Contents tab)?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool

> Hallo,
>
[quoted text clipped - 69 lines]
>
> sFldr = NULL;
Sven Ilius - 24 Feb 2004 06:22 GMT
Ok, Thank you, i will try it soon, but first i have to by OutlookSpy,
my testingphase was running out last week.

by

Sven Ilius
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.