|
最近一直在研究邮件签名的问题,本版有带自定义函数的教程,还是有点遗憾,参考国外网站,经测试可以做到自动添加邮件签名:
Sub test()
Dim OApp As Object, OMail As Object, signature As String
Set OApp = CreateObject("Outlook.Application")
Set OMail = OApp.CreateItem(0)
With OMail
.Display
End With
signature = OMail.body
With OMail
'.To = "someone@somedomain.com"
'.Subject = "Type your email subject here"
'.Attachments.Add
.body = "Add body text here" & vbNewLine & signature
'.Send
End With
Set OMail = Nothing
Set OApp = Nothing
End sub
如果不需要添加默认签名或者有几个签名,可以自动获取路径后添加自己的签名:
SigString = "C:\Users\" & Environ("username") & _
"\AppData\Roaming\Microsoft\Signatures\" & .Range("A1").Value & ".htm"'.Range("A1") 中填入签名文件的名称。
希望对有需要的有所帮助。
|
评分
-
1
查看全部评分
-
|