|
outlook 2003签名中自动更新日期,发新邮件时正常,但转发和答复时,签名无法得到正常信息,
请高手或版主帮忙修改代码,谢谢!(答复和转发,见红色字体部分)
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> </p>" '提供段落
Signature = Signature & "<font color=GRAY>" '设置字体"0000cc蓝色555555浅灰色gray pink粉红 royalblue宝蓝色
Signature = Signature & "<font size=2>" '设置字体大小,可填1~7;数字愈大字也愈大
mDate = Format(Now, "yyyy-MM-dd")
Signature = Signature & "姓名<br />"
Signature = Signature & mDate & mDate & " <br />"
Signature = Signature & "地址+邮编<br />"
Signature = Signature & "Office: 电话号码<br />"
Signature = Signature & "Mobile: 手机号码<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
Else'当邮件名称为空,即发送邮件时,获取签名,但不能得到正常的结果,请问如何修改
With myMailItem
.HTMLBody = Signature() & .HTMLBody
.Display '如果是outlook 2007 将此行注释掉
End With
End If
End Sub
|
|