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...
Best,
Andrew
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"
Best,
Andrew