Hi All,
This is my first thread in the forum!!!
I am trying to create a VBA macro where I want a user to open an email template saved in his computer. below is what I tried but it is not working. Any help is greatly appreciated. Thanks,
Sub MorningOutlookTemplate()
Dim myolapp As Object
Dim morn_template As String
Set myolapp = CreateObject("Outlook.Application")
myolapp.Session.Logon
morn_template = Application.GetOpenFilename(Title:="Please select report file")
If (morn_template <> False) Then GoTo fine
MsgBox ("Exiting Tool Run!!!!!")
fine:
Range("H11") = morn_template
Set openMsg = Application.CreateItemFromTemplate(morn_template)
openMsg.Display
End Sub
This is my first thread in the forum!!!
I am trying to create a VBA macro where I want a user to open an email template saved in his computer. below is what I tried but it is not working. Any help is greatly appreciated. Thanks,
Sub MorningOutlookTemplate()
Dim myolapp As Object
Dim morn_template As String
Set myolapp = CreateObject("Outlook.Application")
myolapp.Session.Logon
morn_template = Application.GetOpenFilename(Title:="Please select report file")
If (morn_template <> False) Then GoTo fine
MsgBox ("Exiting Tool Run!!!!!")
fine:
Range("H11") = morn_template
Set openMsg = Application.CreateItemFromTemplate(morn_template)
openMsg.Display
End Sub