Create message from .msg file

Status
Not open for further replies.

AndrewWeb

Member
Outlook version
Outlook 2013 32 bit
Email Account
Exchange Server
Hi all,

I am a relatively novice visual basic coder, but usually can cobble solutions together. I apologize if I overlooked something obvious related to the following question:

I would like to be able to turn a .msg file into an outlook message. In the GUI, I can do this easily; if I forward a message as an attachment, I can simply drag the attachment to any folder, and then I have that message in the folder as a separate, full-fledged message.

(To illustrate this: E.g., Yesterday, I received a message from John Doe in Account # 1. Today, I forward this message as an attachment from Account # 1 to Account # 2. Account #2 then receives the message + attachment from Account #1. In Account # 2, I can drag that attachment to a Folder X in Account #2, and then Folder X of Account #2 has a message from John Doe sent yesterday.)

I can find tons of posts about saving attachments as files, but nothing about the reverse: turning a .msg file into a message. Is it possible?

I have adapted code (from slipstick, of course!) that allows me to get the attachment in question (objAtt As Outlook.Attachment), and I can confirm it ends in ".msg" or is type olEmbeddeditem, but then...
  • objAtt.copy and objAtt.move don't seem to move the message, e.g.,
    • Dim myInbox as Outlook.Folder
    • Set myInbox = myNameSpace.GetDefaultFolder(olFolderInbox))
    • objAtt.copy myInbox 'no errors thrown, but no action, either
  • I can't seem to create a new message directly from the attachment, e.g.,
    • Dim newMessage as outlook.MailItem
    • Set newMessage = objAtt 'newMessage remains "Nothing"
Any help is much appreciated!
Best,
Andrew
 

AndrewWeb

Member
Outlook version
Outlook 2013 32 bit
Email Account
Exchange Server
Dear Michael,
Thanks very much for the tip; I'm embarrassed that I missed that.

I was able to save and reimport the .msg file, but with one subtle issue:
When I do the attachment drag I described above, the 'new' message appears as a received message. When I use CreateItemFromTemplate, the message appears is in the correct folder, but appears to be a draft (i.e., the send button is active but the 'from' address is John Doe's).

Is there a workaround for that?
Thanks!
 
Status
Not open for further replies.
Top