Can get UserProperty Names but not Values?

A

Adam Dempsey

From C++ using UserProp->Name I can get the name of a UserProperty,
but UserProp->Value.bstrVal always returns nothing, anyone have any
ideas what I could be doing wrong and has anyone ever accessed
UserProperties from C++?


UserPropertiesPtr UserProps = Con->UserProperties;
if (UserProps->Count > 0)
{
tot = UserProps->Count;
UserPropertyPtr UserProp;
for (i=1;i < tot + 1;i++)
{
UserProp = UserProps->Item(i);
MessageBox(NULL,UserProp->Name,"Test - Name",MB_OK);
char* sText;
sText = (char*)UserProp->Value.bstrVal;
MessageBox(NULL,sText,"Test - Value",MB_OK);
}
}
 
B

Brian Tillman

Adam Dempsey said:
but UserProp->Value.bstrVal always returns nothing, anyone have any
ideas what I could be doing wrong and has anyone ever accessed
UserProperties from C++?

You might have better luck in the programming groups.
microsoft.public.outlook.program_addins,
microsoft.public.outlook.program_forms, microsoft.public.outlook.program_vba
 
D

Dmitry Streblechenko

Do you see the properties in MFCMAPI or OutlookSpy (click IMessage)?
Are you use you have a string property? What is the value of
UserProp->Value.vt?

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

Adam Dempsey

Do you see the properties in MFCMAPI or OutlookSpy (click IMessage)?
Are you use you have a string property? What is the value of
UserProp->Value.vt?

I got it sorted in the end

_variant_t v;
v.Attach (UserProp->GetValue());
_bstr_t b = (_bstr_t)(v);
 

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