Pinaceous
Well-known Member
- Joined
- Jun 11, 2014
- Messages
- 1,124
- Office Version
- 365
- Platform
- Windows
Hi All,
I want to send an email through vba in using an Outlook template.
The code that I have references a drive pathway:
I would like to provide Set OutMail to Thisworkbook.Path as referenced as in the following proposed example.
For example;
Can someone help me?
Thank you!
pinaceous
I want to send an email through vba in using an Outlook template.
The code that I have references a drive pathway:
VBA Code:
Dim FileExtStr As String
Dim FileFormatNum As Long
Dim Sourcewb As Workbook
Dim Destwb As Workbook
Dim TempFilePath As String
Dim TempFileName As String
Dim OutApp As Object
Dim OutMail As Object
Dim varMyAttachment As Variant
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItemFromTemplate("C:\Folder1\Folder2\Folder3\Folder4\Folder5\Folder6\Titled.msg") 'Change path to object.
'getParentFolder(ThisWorkbook.Path) & "\" & Worksheets(1).Range("A39").Text
With OutMail
'.To = ""
'.CC = ""
'.BCC = ""
'.Subject = ""
I would like to provide Set OutMail to Thisworkbook.Path as referenced as in the following proposed example.
For example;
VBA Code:
Set OutMail = OutApp.CreateItemFromTemplate(getParentFolder(ThisWorkbook.Path) & "\" & Worksheets(1).Range("A39").Text") 'Change path to object.
Can someone help me?
Thank you!
pinaceous