Hi, I've been at this for hours, and for some reason even though my .oft does not have a signature, when I generate an outlook email from my .oft using vba, it adds my default signature to the bottom. Any ideas on how to remove this? I've tried every variation of code found online. thanks!
VBA Code:
Sub Email_Macro_InPerson()
' Working in Office 2000-2016
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim FirstNameArray As Variant
Dim LastNameArray As Variant
Dim EmailArray As Variant
Dim AttachmentArray As Variant
Dim Name As Variant
Dim FullName As Variant
Dim Email As Variant
Dim Attachment As Variant
Dim sourcefile As String
Dim strName As String
Dim strEmail As String
Dim strSalesEmail As String
Set myOlApp = CreateObject("Outlook.Application")
'Dim msgDoc As Object 'outlook wordprocessing editor
'start to loop
Set wksTemp = ActiveSheet
Set rng = Range("C2", Range("C" & Rows.Count).End(xlUp))
For Each r In rng 'loop through each work effort
'STRING VALUES
strName = Cells(r.Row, "A")
strSalesEmail = Cells(r.Row, "D")
strEmail = Cells(r.Row, "C")
Set myItem = myOlApp.CreateItemFromTemplate("H:\file.oft")
With myItem
.CC = strSalesEmail
.BCC = "email.com"
strbody = .HTMLBody
'STRING VALUES
strName = Cells(r.Row, "A")
strEmail = Cells(r.Row, "C")
'What to Replace
.HTMLBody = getNewHTML(.HTMLBody, strName, 2, "XXNameXX")
.SentOnBehalfOfName = "email.com"
.To = r.Value
.Importance = 2
.Display
' Set msgDoc = myItem.GetInspector.WordEditor
' msgDoc.Select
'msgDoc.Windows(1).Selection.Copy
'myItem.BodyFormat = olFormatRichText
'msgDoc.Range.Paste
'.BodyFormat = 3
End With
Wait
Next r
Set myItem = Nothing
Set myOlApp = Nothing
Application.DisplayAlerts = False
Application.DisplayAlerts = True
End Sub