我想知道当您输入Outlook 2010的收件人地址以自动检测此地址并相应更改签名时是否可能?只是一个普遍的问题。
答案 0 :(得分:3)
我有同样的问题,到目前为止还没有找到答案。作为一个很好的解决方法,我已成功使用此处提供的解决方案:https://superuser.com/a/228633/74819。最后,您可以在工具栏上找到一个按钮,允许您使用自定义的To地址和您选择的预定义正文(包括签名)创建新消息。
现在我发现这个方法比我想要的更好,因为它更容易预测。如果签名(以及邮件正文)根据收件人列表进行更改,您将失去对文本的控制权。此外,使用您自己的工具,您可以设置的不仅仅是签名。
答案 1 :(得分:2)
您是否正在寻找设置来执行此操作,或者您是否愿意使用宏?如果您愿意使用宏,请参阅下文并回答问题。
Public WithEvents goInspectors As Outlook.Inspectors
Public WithEvents myMailItem As Outlook.MailItem
Private Sub Application_Startup()
Initialize_Inspector
End Sub
Private Sub Initialize_Inspector()
Set goInspectors = Outlook.Application.Inspectors
End Sub
Private Sub goInspectors_NewInspector(ByVal Inspector As Inspector)
If Inspector.currentItem.Class = olMail Then
Set myMailItem = Inspector.currentItem
End If
End Sub
Private Sub myMailItem_PropertyChange(ByVal Name As String)
'The variable below should be modified for your situation.
'If you are in an Exchange environment, then you can use "last name, firstname"(caps-sensitive).
'If the the recipient is not in Outlook's address list, use "person@email.com"
customSignatureFor = "Lastname, Firstname"
'Use vbCrLf to account for enter/returns
oldSignature = "Respectfully," & vbCrLf & vbCrLf & "Phillip"
newSignature = "v/r," & vbcrlf & "Phil"
If Name = "To" Then
For i = 1 To myMailItem.Recipients.count
If InStr(myMailItem.Recipients(i), customSignatureFor) > 0 Then
tempstring = Replace(myMailItem.Body, oldSignature, newSignature)
myMailItem.Body = tempstring
End If
Next
End If
End Sub