Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

persisting CDO custom property in msg file

31 views
Skip to first unread message

Bushey Billy

unread,
Dec 31, 2009, 4:18:01 AM12/31/09
to
We use custom properties in our exchange environment, specifically a
userproperty called "FileNo"
This persists whilst the message is in an exchange folder.
If I save the email in msg format, and double-click to open, then the custom
properties are lost.
However, if I open outlook, then drag the icon for the saved file on to my
inbox, it will add the message complete with user properties in tact.
From what I've read, Outlook opens up .msg in the temporary/default store
(wherever that is?)
How can I force the properties to persist when opening the message? Do I add
the userproperty to this elusive temporary folder or is there a registry fix?

thank you kindly

Joel

Dmitry Streblechenko

unread,
Dec 31, 2009, 11:10:51 AM12/31/09
to
How weas that property added?
Do you see that property if you look at the saved MSG file in OutlookSpy
(click Misc | OPenIMsgOnIStg)?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Bushey Billy" <Bushe...@discussions.microsoft.com> wrote in message
news:64A96A6D-5BA0-42A9...@microsoft.com...

Bushey Billy

unread,
Dec 31, 2009, 2:09:01 PM12/31/09
to
Property was added using .net code from outlook add-in:
Mail1.UserProperties.Add("FileNo", Outlook.OlUserPropertyType.olText, True)

yes, the property is visible in the OutlookSpy programme (good programme by
the way)

as i say, if i drag the .msg icon over the inbox, it will open the message
in that folder, and since that folder already has that userproperty, the CDO
will persist. it's only when double-clicking it it seems to open it in a
temporary folder and loses the property.

thanks
joel


"Dmitry Streblechenko" wrote:

> .
>

Bushey Billy

unread,
Dec 31, 2009, 2:49:01 PM12/31/09
to
Also - one last symptom that may help solve this.
When I double-click the icon, the userproperties are empty, and my code does
not pick up the fileno property from code
mailitem.UserProperties("FileNo").Value
however, when I click on the IMessage icon of OutlookSpy, the FileNo
property IS there - just not under UserProperties. It has property tag 0x809A.
Do you think I could convert the message to an IMessage in the add-in, then
enumerate through the properties finding the name that matches?

"Dmitry Streblechenko" wrote:

> .
>

Bushey Billy

unread,
Dec 31, 2009, 3:25:02 PM12/31/09
to

Found it with your OutlookSpy:

Dim varProperty As Object
Try
varProperty =
mailitem.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/FileNo")
Catch ex As Exception

The sequencing is important: I need to save the email with changed
userproperty, then output the email to .msg format. Then it will maintain the
property above (althouth not the userproperty)

I can set my code to check for either property.

thank you for pointing me in the right direction Dmitry

"Dmitry Streblechenko" wrote:

> .
>

Dmitry Streblechenko

unread,
Jan 2, 2010, 8:58:19 PM1/2/10
to
But do you see the blob that contcats user properties definitions in both
folder and MSG based Imessage?
If teh property definition is not in the blob, UserProperties colelction
will nto see even if the value (which is stored as a regular named property)
is there.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Bushey Billy" <Bushe...@discussions.microsoft.com> wrote in message

news:EE8C1538-2027-47C9...@microsoft.com...

0 new messages