-1

How do I delete the automatic signature in Outlook 2010?

I have a document in Excel 2010. There is a button to email the document. It opens an email in Outlook 2010 and my signature generates.

I need to delete the Outlook 2010 signature from this email.

I want the signature deleted from these emails because I am using electronic fax. If the signature is in the email, the fax will generate an extra page.

I do not want to disable my signature because I want it for real email.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Mark
  • 178
  • 1
  • 2
  • 16

2 Answers2

0

What is your code that creates the message and displays it? If you set the MailItem.Body property, the signature will not be inserted:

set App = CreateObject("Outlook.Application")
set item = App.CreateItem(0)
item.To = "somebody@domain.demo"
item.Subject = "test"
item.Body = " "
set attach = item.Attachments.Add("c:\temp\myspreadsheet.xls")
item.Display

To reset the body in your code above, try the following change (set Body to an empty string after calling Display).

With OutMail
        .To = FaxNum2
        .CC = ""
         .BCC = ""
        .Subject = accno & " / Name Form"
        .Attachments.Add Destwb.FullName
        'You can add other files also like this
        '.Attachments.Add ("C:\test.txt")
        '.Send
        .Display
        .Body = "" 
    End With
Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • I posted the response as an answer. It wouldn't let me post the damn answer! Thanks for your help so far, I appreciate it. – Mark Aug 14 '15 at 21:56
  • You can edit your original port. Why not reset the Body property after calling Display (that is when the signature is added)? – Dmitry Streblechenko Aug 14 '15 at 22:03
  • I will try it. I'm sorry but I'm a little new when it comes to VBA. I didn't write the code, I took over the document from a coworker. Could you write out the code I should use in an answer? Use my code and write it how it should be if you don't mind. Thanks smithy. – Mark Aug 16 '15 at 01:44
  • Thanks!! Easy to read and clean code. I really appreciate it! I'm excited to test this out – Mark Aug 16 '15 at 04:08
  • Worked like a charm. Thank you Dmitry, you're SMART. – Mark Aug 16 '15 at 16:38
  • Mark, please mark the reply as an answer if it answers your question. – Dmitry Streblechenko Aug 16 '15 at 19:15
  • I clicked the check mark. Let me know if that's what you wanted. Thanks! – Mark Aug 17 '15 at 12:24
0
'Save the new workbook/Mail it/Delete it
TempFilePath = Environ$("temp") & "\"
TempFileName = "" & Sourcewb.Name & " " _
             & Format(Now, "dd-mmm-yy")
'TempFileName = "" & Sourcewb.Name
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

With Destwb
    .SaveAs TempFilePath & TempFileName & FileExtStr, _
            FileFormat:=FileFormatNum
    On Error Resume Next
    With OutMail
        .To = FaxNum2
        .CC = ""
         .BCC = ""
        .Subject = accno & " / Name Form"
        '.Body = Embody
        .Attachments.Add Destwb.FullName
        'You can add other files also like this
        '.Attachments.Add ("C:\test.txt")
        '.Send
        .Display
    End With
    On Error GoTo 0
    '.Close savechanges:=False
End With

'Delete the file you have send

'Kill TempFilePath & TempFileName & FileExtStr

Set OutMail = Nothing
Set OutApp = Nothing
' MsgBox ("Please click OK to close the tool!")
'  Application.DisplayAlerts = False
'ThisWorkbook.Close savechanges:=False
 ActiveWorkbook.Close False
 'ActiveWorkbook.Close False
 'Application.Quit
 Call ClrForms

End Sub

Mark
  • 178
  • 1
  • 2
  • 16