在Outlook 2010中删除签名

时间:2015-08-14 12:30:01

标签: excel vba email outlook-vba outlook-2010

如何删除Outlook 2010中的自动签名?

我在Excel 2010中有一个文档。有一个按钮可以通过电子邮件发送文档。它在Outlook 2010中打开一封电子邮件,我的签名生成。

我需要从此电子邮件中删除Outlook 2010签名。

我希望从这些电子邮件中删除签名,因为我使用的是电子传真。如果签名在电子邮件中,则传真将生成额外页面。

我不想禁用我的签名,因为我想要它用于真正的电子邮件。

2 个答案:

答案 0 :(得分:0)

创建消息并显示消息的代码是什么?如果设置MailItem.Body属性,则不会插入签名:

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

要重置上面代码中的正文,请尝试以下更改(在调用Display后将Body设置为空字符串)。

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

答案 1 :(得分: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