General_GSpot
asked on
opening an outlook .msg from a directory store, vb.
we have a program called MessageSave which lets users store sent emails in a folder for archiving. The users can then see the messages using a VB program, and even read the contents from some textboxes. I've made it so they can print, but the users would actually like to open up those messages in an Outlook message form because the printing is better, and they can use the calendar as well.
I've tried Process.Start("outlook.exe ", ?) but I'm not sure how to make outlook open that email directly.
Here is the code I had so far.
I guess I'm not sure how to pass the .msg as an argument to outlook.
Is Process.start even the right thing to use here?
I've tried Process.Start("outlook.exe
Here is the code I had so far.
Private Sub btnOutlook_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOutlook.Click
Dim folder As String = CStr(TreeView1.SelectedNode.Tag)
Dim file As String = folder.ToString
If ListView1.SelectedItems.Count > 0 Then
Dim lvO As ListViewItem = ListView1.SelectedItems(0)
Dim filename As String = file & "\" & lvO.Text
Dim msg As MapiMessage = MapiMessage.FromFile(filename)
Process.Start("outlook.exe")
End If
End Sub
I guess I'm not sure how to pass the .msg as an argument to outlook.
Is Process.start even the right thing to use here?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Kept googling and eventually found the answer
You could pass the /f switch as part of your parameter so:
Process.Start("outlook.exe
Hope that helps.