|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
我的是2003,一直在用,LZ试试.
dim myOlApp As New Outlook.Application
Private WithEvents myOlInspectors As Outlook.Inspectors
Private myMailItem As Outlook.MailItem
Function Signature() As String
Dim mDate As Date
'Signature = "<p>& mDate &</p><br/><br/><br/><br/><br/><br/>" '黑色字体
' Signature = "<br/><br/><br/>"
Signature = "<p> </p>" '提供段落
Signature = Signature & "<p> </p>" '提供段落
Signature = Signature & "<font color=GRAY>" ''设置字体"0000cc蓝色555555浅灰
色gray pink粉红 royalblue宝蓝色
Signature = Signature & "<font size=3>" '设置字体大小,可填1~7;数字愈大字也
愈大
mDate = Format(Now, "yyyy-MM-dd")
Signature = Signature & "姓名<br />"
Signature = Signature & mDate & " <br />"
'Signature = Signature & mDate & "(" & Left(NongLi(mDate), 2) & Mid(NongLi
(mDate), 9, 5) & ")" & " <br />"
Signature = Signature & "地址+邮编<br />" '<p style=""""font-size:
30px;"""">
Signature = Signature & "电话<br />"
Signature = Signature & "手机<br />"
Signature = Signature & " E-mail: <ahref=""""mailto:邮箱"""">邮箱</a>
<br />"
Signature = Signature & "</font>"
Signature = Signature & "</font>"
End Function
Private Sub Application_Startup()
'GetSignature
Set myOlInspectors = myOlApp.Inspectors
End Sub
Private Sub myOlInspectors_NewInspector(ByVal Inspector As Inspector)
Set myMailItem = Inspector.CurrentItem
If myMailItem.Subject = "" Then
With myMailItem
.HTMLBody = Signature()
.Display '如果是outlook 2007 将此行注释掉
End With
End If
End Sub |
|