Hello everyone,
Hoping that someone can help me...
Currently have this VBA and it has been stripped to make it web friendly.
I want to know, is there a way to use this same functionality but instead of using it on a local desktop version of the .oft file, can it be used on an embedded file instead.
So, if I were to go to Insert > Object > Browse > Select the .oft file, it would embed the file as on object, so I want to know how I can perform the function below of replacing something within the embedded template instead of the local file.
Hoping that someone can help me...
Currently have this VBA and it has been stripped to make it web friendly.
I want to know, is there a way to use this same functionality but instead of using it on a local desktop version of the .oft file, can it be used on an embedded file instead.
So, if I were to go to Insert > Object > Browse > Select the .oft file, it would embed the file as on object, so I want to know how I can perform the function below of replacing something within the embedded template instead of the local file.
Excel Formula:
Sub SendEmail()
Dim nEmail As MailItem
Dim PathFileName As String
PathFileName = "C:\PATH_TO_OFT_FILE\TEMPLATE.oft"
Set nEmail = CreateItemFromTemplate(PathFileName)
With nEmail
.Subject = Worksheets("Email").Range("A1").Value
.HTMLBody = Replace(.HTMLBody, "#Name", Worksheets("Email").Range("A2").Value)
.SentOnBehalfOfName = "TEST@EMAIL.COM"
BodyWithoutSignature = .HTMLBody
.Display
.HTMLBody = BodyWithoutSignature
End With
End Sub