msoutlook.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Opening a .msg file in OL via shellext vs importing

 
Post new topic   Reply to topic    msoutlook.org Forum Index -> Outlook Programs Add-Ins
Author Message
Mark J. McGinty



Joined: 13 Aug 2007
Posts: 8

PostPosted: Sun Feb 17, 2008 1:51 pm    Post subject: Opening a .msg file in OL via shellext vs importing Reply with quote

While experimenting with .msg files, created using
Redemption.SafeMail.SaveAs, and then opened by double-clicking in the file
system, it appeared to me that UserProperties are persisted in the .msg
file. But when I use Import, to get OOM MailItem object access to a saved
..msg, the UserProperties collection is empty.

I'm a little confused as to what is actually taking place, I see I need to
have an existing MailItem assigned to SafeMail.item before I can call
import. Does that over-write the existing MailItem, if I call Save?

If I get a MailItem reference to the email in Outlook from which the .msg
was created, and assign that to SafeMail.item, I can access the
UserProperties, they remain intact, but I was hoping to avoid the need to
locate the original email. (Plus I'm not really sure what is or is not
coming from the .msg this way.)

I'm also struggling with the concept of User-defined fields defined in this
item vs User-defined fields defined in Inbox (in this case.) When I open
the .msg in Outlook, my U-D fields show as being defined in the folder, but
not the item? What's wrong with this picture?


I was already saving as .msg for other reasons, primarily to upload to
another system. The upload process needs a few values stored in the item as
UserProperties What I was hoping was that each .msg file would be
completely self-contained, i.e., hoping I'd be able to read the
UserProperties directly from the .msg files.

I suppose it'd be easy enough to use some other storage, if it's impractical
to do what I had planned... any insight appreciated.


-Mark

Archived from group: microsoft>public>outlook>program_addins
Back to top
View user's profile Send private message
Dmitry Streblechenko



Joined: 12 Aug 2007
Posts: 220

PostPosted: Sun Feb 17, 2008 3:28 pm    Post subject: Re: Opening a .msg file in OL via shellext vs importing Reply with quote

See below

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

"Mark J. McGinty" wrote in message
news:%23zXLFVYcIHA.4144@TK2MSFTNGP05.phx.gbl...
> While experimenting with .msg files, created using
> Redemption.SafeMail.SaveAs, and then opened by double-clicking in the file
> system, it appeared to me that UserProperties are persisted in the .msg
> file. But when I use Import, to get OOM MailItem object access to a saved
> .msg, the UserProperties collection is empty.

Most likely Outlook does not see the changes made by Import() in Redemption
until
you dereference and reopen the message.

> I'm a little confused as to what is actually taking place, I see I need to
> have an existing MailItem assigned to SafeMail.item before I can call
> import. Does that over-write the existing MailItem, if I call Save?

Yes, Import copies all properties from the MSG file and overwrites all the
existing properties.

>
> If I get a MailItem reference to the email in Outlook from which the .msg
> was created, and assign that to SafeMail.item, I can access the
> UserProperties, they remain intact, but I was hoping to avoid the need to
> locate the original email. (Plus I'm not really sure what is or is not
> coming from the .msg this way.)

You should be able to use Safe*Item.Fields() to read any user properties,
they are nothing but named MAPI properties:
http://www.dimastr.com/redemption/utils.htm#xmapi

>
> I'm also struggling with the concept of User-defined fields defined in
> this item vs User-defined fields defined in Inbox (in this case.) When I
> open the .msg in Outlook, my U-D fields show as being defined in the
> folder, but not the item? What's wrong with this picture?

Properties that are defined on the folder level, have their definition
stored in a
hidden message in that folder.
User properties stored on a particular item are regular MAPI properties.
Their definitions
are also stored in yet another named MAPI property.

> I was already saving as .msg for other reasons, primarily to upload to
> another system. The upload process needs a few values stored in the item
> as UserProperties What I was hoping was that each .msg file would be
> completely self-contained, i.e., hoping I'd be able to read the
> UserProperties directly from the .msg files.

If you all yu need is read some properties from an MSG file, you do not
have to bring it back to Outlook - open it directly using
RDOSession.GetMessageFromMsgFile and access custom properties
using RDOMail.Fields().

>
> I suppose it'd be easy enough to use some other storage, if it's
> impractical to do what I had planned... any insight appreciated.
>
>
> -Mark
>
Back to top
View user's profile Send private message
Mark J. McGinty



Joined: 13 Aug 2007
Posts: 8

PostPosted: Mon Feb 18, 2008 3:05 pm    Post subject: Re: Opening a .msg file in OL via shellext vs importing Reply with quote

Awesome, that's exactly what I needed -- thanks again!

-Mark


"Dmitry Streblechenko" wrote in message @TK2MSFTNGP05.phx.gbl...
> See below
>
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> "Mark J. McGinty" wrote in message
> news:%23zXLFVYcIHA.4144@TK2MSFTNGP05.phx.gbl...
>> While experimenting with .msg files, created using
>> Redemption.SafeMail.SaveAs, and then opened by double-clicking in the
>> file system, it appeared to me that UserProperties are persisted in the
>> .msg file. But when I use Import, to get OOM MailItem object access to a
>> saved .msg, the UserProperties collection is empty.
>
> Most likely Outlook does not see the changes made by Import() in
> Redemption until
> you dereference and reopen the message.
>
>> I'm a little confused as to what is actually taking place, I see I need
>> to have an existing MailItem assigned to SafeMail.item before I can call
>> import. Does that over-write the existing MailItem, if I call Save?
>
> Yes, Import copies all properties from the MSG file and overwrites all the
> existing properties.
>
>>
>> If I get a MailItem reference to the email in Outlook from which the .msg
>> was created, and assign that to SafeMail.item, I can access the
>> UserProperties, they remain intact, but I was hoping to avoid the need to
>> locate the original email. (Plus I'm not really sure what is or is not
>> coming from the .msg this way.)
>
> You should be able to use Safe*Item.Fields() to read any user properties,
> they are nothing but named MAPI properties:
> http://www.dimastr.com/redemption/utils.htm#xmapi
>
>>
>> I'm also struggling with the concept of User-defined fields defined in
>> this item vs User-defined fields defined in Inbox (in this case.) When I
>> open the .msg in Outlook, my U-D fields show as being defined in the
>> folder, but not the item? What's wrong with this picture?
>
> Properties that are defined on the folder level, have their definition
> stored in a
> hidden message in that folder.
> User properties stored on a particular item are regular MAPI properties.
> Their definitions
> are also stored in yet another named MAPI property.
>
>> I was already saving as .msg for other reasons, primarily to upload to
>> another system. The upload process needs a few values stored in the item
>> as UserProperties What I was hoping was that each .msg file would be
>> completely self-contained, i.e., hoping I'd be able to read the
>> UserProperties directly from the .msg files.
>
> If you all yu need is read some properties from an MSG file, you do not
> have to bring it back to Outlook - open it directly using
> RDOSession.GetMessageFromMsgFile and access custom properties
> using RDOMail.Fields().
>
>>
>> I suppose it'd be easy enough to use some other storage, if it's
>> impractical to do what I had planned... any insight appreciated.
>>
>>
>> -Mark
>>
>
>

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Exchange folder and cached folder in OST file not in sync We have written a server application that periodically accesses certain folders in Exchange user's mailboxes (for which the server has permission) and moves the messages to the Deleted Items folder. The application is a service running on Windows XP or S

importing an .ost file to OL2007 Hi, I was using Outlook 2003 at my previous employer on a MS Exchange server. Before I left I backed up my .ost file and .pst files. I am running Outlook 2007 at home and am trying to work out how to open the ..ost folder. It appears to only be looking fo

Transfer pst File after Importing In order to transfer Outlook to new PC (both Office 2003; WinXP Pro) I made the mistake of trying to import Outlook data into the new machine. My mail is tied to an Exchange server and I use a local cache. I also have a Hotmail account in Outlook and a

importing dbx file in Windows mail If I import .dbx files in Windows mail, does it delete same name folders and replace or does it add the content to it ? Thx. Jean

importing Vista email file folders from disc Before returning a laptop that had VISTA I loaded all of my files that I had received by email and placed into locals folders ...(receipts, flight etc.) onto a disc hoping for some setup wizard to show up when I received my new laptop. Whe
Post new topic   Reply to topic    msoutlook.org Forum Index -> Outlook Programs Add-Ins All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group