PC Review


Reply
Thread Tools Rate Thread

Can get UserProperty Names but not Values?

 
 
Adam Dempsey
Guest
Posts: n/a
 
      12th Oct 2007
>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);
}
}

 
Reply With Quote
 
 
 
 
Brian Tillman
Guest
Posts: n/a
 
      12th Oct 2007
Adam Dempsey <(E-Mail Removed)> wrote:

>> 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++?


You might have better luck in the programming groups.
microsoft.public.outlook.program_addins,
microsoft.public.outlook.program_forms, microsoft.public.outlook.program_vba
--
Brian Tillman [MVP-Outlook]

 
Reply With Quote
 
Dmitry Streblechenko
Guest
Posts: n/a
 
      12th Oct 2007
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

"Adam Dempsey" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> >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);
> }
> }
>



 
Reply With Quote
 
Adam Dempsey
Guest
Posts: n/a
 
      14th Oct 2007
On 12 Oct, 17:57, "Dmitry Streblechenko" <dmi...@dimastr.com> wrote:
> 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);

 
Reply With Quote
 
Michael Tissington
Guest
Posts: n/a
 
      15th Oct 2007
_bstr_t b = UserProp->getValue().bstrVal

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: file names and folder names have been changed into some values automatically Malke Windows Vista File Management 0 11th Jul 2008 01:10 PM
Iterating Through UserProperty Values Henry Stockbridge Microsoft Outlook VBA Programming 2 22nd Jun 2008 08:35 PM
Can get UserProperty Names but not Values? Adam Dempsey Microsoft Outlook 4 15th Oct 2007 03:07 AM
Can get UserProperty Names but not Values? Adam Dempsey Microsoft Outlook Program Addins 4 15th Oct 2007 03:07 AM
Is there a way to give range names (especially with relative reference) for series names and series values in Excel 2007 graphs? johns_myself@yahoo.com Microsoft Excel Programming 0 16th Aug 2007 02:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:12 PM.