Hidden-Folder-Items with Redemption with VC++

S

Sven Ilius

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;
 
D

Dmitry Streblechenko \(MVP\)

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
 
S

Sven Ilius

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top