Saphirah
Active member
- Local time
- Today, 05:21
- Joined
- Apr 5, 2020
- Messages
- 163
Hey everyone
I created a system that automatically links emails from outlook to orders by storing the emails as a .msg file on our server.
You can then open the msg file again by pressing a button in a form. To open the Msg File i am using the following code:
This simply opens the file using the default program for Msg Files (which is outlook) via Shell.
But when i now press "Reply" on the opened email, outlook will create a reply using the standart account of the PC.
We do have a custom account for order replies though. So i want to make outlook use this account instead.
So the question is, how can i open the msg file using a specific account, so that it automatically replies with the correct account? Or, if that is impossible, how can i make outlook change account whenever i hit the reply button? Do i need to change the ribbon for that?
Thank you very much for your help!
I created a system that automatically links emails from outlook to orders by storing the emails as a .msg file on our server.
You can then open the msg file again by pressing a button in a form. To open the Msg File i am using the following code:
Code:
Public Declare PtrSafe Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hWnd As Long, _
ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Dim FileName As String: FileName = "Path/To/Folder/Email_Orders/" & EmailID & ".msg"
Call ShellExecute(0&, vbNullString, FileName, vbNullString, vbNullString, vbNormalFocus)
This simply opens the file using the default program for Msg Files (which is outlook) via Shell.
But when i now press "Reply" on the opened email, outlook will create a reply using the standart account of the PC.
We do have a custom account for order replies though. So i want to make outlook use this account instead.
So the question is, how can i open the msg file using a specific account, so that it automatically replies with the correct account? Or, if that is impossible, how can i make outlook change account whenever i hit the reply button? Do i need to change the ribbon for that?
Thank you very much for your help!