tbakbradley
Board Regular
- Joined
- Sep 24, 2010
- Messages
- 142
I have a Maco that will open a specific Worksheet. The Save As Dialog Box then appears so the Employee can save the file. Once finished, a two saved .msg Email Templates are opened from a Server that already includes the Address, Subject Line and Body for each Template.
Is there a way, within the macro, to capture the File Name and Path provided by the employee on the active workbook and then attach that file to the two .msg outlook file that opens?
I'm not sure if this is doable, but would love to see as it would save the Employees time attaching the same file to two different emails (why we can't just sent one to both parties......don't ask )
Is there a way, within the macro, to capture the File Name and Path provided by the employee on the active workbook and then attach that file to the two .msg outlook file that opens?
Code:
Sub Data_Build()
Application.EnableEvents = False
Sheets("FIM Data").Visible = True
Sheets("FIM Data").Select
Range("A1").Select
MsgBox "Save your File and attach it to the Email Templates that open Automatically", vbExclamation, "Save and Send"
Application.Dialogs(xlDialogSaveAs).Show
Application.EnableEvents = True
Call OpenFIMOutlookTemplate
Call OpenJeffOutlookTemplate
Code:
Sub OpenFIMOutlookTemplate()
Dim myolapp As Object
Dim myitem As Object
Set myolapp = CreateObject("Outlook.Application")
Set myitem = myolapp.CreateItemFromTemplate("\\Server\Folders\Email to FIM IT.msg")
myitem.Display
End Sub
Code:
Sub OpenJeffOutlookTemplate()
Dim myolapp As Object
Dim myitem As Object
Set myolapp = CreateObject("Outlook.Application")
Set myitem = myolapp.CreateItemFromTemplate("\\Server\Folders\Email to Jeff.msg")
myitem.Display
End Sub
I'm not sure if this is doable, but would love to see as it would save the Employees time attaching the same file to two different emails (why we can't just sent one to both parties......don't ask )
Last edited: