我正在制作一个转发邮件的脚本,如果收件人,发件人和主题是正确的。对于前者
如果一切都为真,则转发邮件:
Or
嗨这是我目前的剧本
Public Sub FW(olItem As Outlook.MailItem)
Dim Msg As Outlook.MailItem
Set Msg = Item
If Msg.SenderEmailAddress = "OneGuy@mail.com" Then
ElseIf Msg.To = "OtherGuy@mail.com" Then
ElseIf Msg.Subject = "Hallo" Then
ElseIf Msg.Subject = "Hi" Then
Dim olForward As Outlook.MailItem
Set olForward = olItem.Forward
With olForward
'Stuff happens here that work properly
End With
End If
'// Clean up
Set olItem = Nothing
Set olForward = Nothing
Set Msg = Nothing
End Sub
答案 0 :(得分:3)
If Msg.SenderEmailAddress = "OneGuy@mail.com" AND Msg.To = "OtherGuy@mail.com" AND Msg.Subject = "Hallo" AND Msg.Subject = "Hi" Then