VB.NET Create an Outlook Reply-Message from a msg-file in filesystem

MarcM1975 21 Reputation points
2022-07-01T07:49:16.283+00:00

Hello,

we want to create a Reply-Message in our VB.NET Project from a Outlook-Message File (msg).
Backgroud is, that out Support-System archives incoming messages as msg-Files.
The user should be able to push the reply or reply all button - and when sends the mail the application write the new .msg-file back in a database.

I can open these files with Outlook from our ERP-App with:

oOutL = New Outlook.Application
oMail = oOutL.CreateItem(Outlook.OlItemType.olMailItem)
oMail = oOutL.CreateItemFromTemplate("C:\temp\OEM\Test.msg")
oMail.Display(True)

But this diplays the message in edit-mode and I have no reply-button to answer:

216799-outlook1.jpg

If I start the msg-file with a process.start(C:\temp\OEM\Test.msg) - command - I get a message with reply buttons but can't take care of the onSend-Event later.

216789-outlook2.jpg

Is there a way to create an Outlook Message from a .msg-File and and display the reply/reply-all buttons (or put it in reply mode) from vb.net (to take care of the onsend event later and write the reply message back to our database when the user sends the reply message)?

Thanks for any Help.

Regards,

Marco

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,425 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,583 questions
Outlook Management
Outlook Management
Outlook: A family of Microsoft email and calendar products.Management: The act or process of organizing, handling, directing or controlling something.
4,915 questions
0 comments No comments
{count} votes

Accepted answer
  1. RLWA32 40,856 Reputation points
    2022-07-01T10:53:08.383+00:00

    This worked for me with Outlook 2013

    olApp = New Microsoft.Office.Interop.Outlook.Application()  
    olSess = olApp.Session  
    mi = olSess.OpenSharedItem("Path to .msg file")  
    mi.Display(True)  
    olApp.Quit()  
      
    

0 additional answers

Sort by: Most helpful