ExcelHome技术论坛

 找回密码
 免费注册

QQ登录

只需一步,快速开始

快捷登录

搜索
EH技术汇-专业的职场技能充电站 妙哉!函数段子手趣味讲函数 Excel服务器-会Excel,做管理系统 Excel Home精品图文教程库
HR薪酬管理数字化实战 Excel 2021函数公式学习大典 Excel数据透视表实战秘技 打造核心竞争力的职场宝典
300集Office 2010微视频教程 数据工作者的案头书 免费直播课集锦 ExcelHome出品 - VBA代码宝免费下载
用ChatGPT与VBA一键搞定Excel WPS表格从入门到精通 Excel VBA经典代码实践指南
查看: 6401|回复: 7

[求助]Outlook2003 能否实现redirect邮件的功能

[复制链接]

TA的精华主题

TA的得分主题

发表于 2008-5-28 11:00 | 显示全部楼层 |阅读模式
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助
我用的是outlook2003,经常会收到别人发给我的邮件,其实是发给他的,收件人还是他,不是我,但是是到我的邮箱,发件人也是原来的发件人,不是他,也就是说,我看到的收件人和发件人,跟他收到的时候是一样的。他用的是苹果的电脑,里面有这个redirect的功能,请问outlook2003里面能不能实现同样的功能?

TA的精华主题

TA的得分主题

 楼主| 发表于 2008-5-28 13:42 | 显示全部楼层

没人回答吗?求各位帮帮忙吧,有急用

TA的精华主题

TA的得分主题

发表于 2008-6-2 03:51 | 显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用  · 内置多项VBA编程加强工具       ★ 免费下载 ★      ★使用手册
用规则和通知,当他收到邮件同时转一份给你。

TA的精华主题

TA的得分主题

 楼主| 发表于 2008-6-2 09:40 | 显示全部楼层

谢谢,但是这样的话,就是转发了,收件人和发现人跟他收到的时候就不一样了,我想要达到的效果是收件人和发件人都不变,不知道可不可以?

TA的精华主题

TA的得分主题

发表于 2008-6-3 05:02 | 显示全部楼层

1. 你先试试规则与通知。不会跟转发一样。

2. 网上有add-in,但要花钱。

http://www.office-addins.com/-outlook-addins/redirect-for-outlook.html

[此贴子已经被作者于2008-6-3 5:13:46编辑过]

TA的精华主题

TA的得分主题

发表于 2008-6-4 02:32 | 显示全部楼层

无意中看到以下代码。你可以试试。

转自:http://www.codeforexcelandoutlook.com/Outlook.html

http://www.outlookcode.com/codedetail.aspx?id=1769(这里也有)

Sub RedirectMail()
'
' This macro forwards the active mail item, or if you are in the explorer window, select one email and run this code
'1. The original sender of the mail, and the newly selected recipient are placed in the "To:" field
'2. Directs replies to the newly selected recipient
'3. Add everybody else on the CC line (so they can safely ignore, since they shouldn't have received it in the first place)
'5. Disables "Reply to All" (optional)
' based on OL2007 code from aaronlerch.com
'
Dim CurrMail As Outlook.MailItem
Dim NewFwd As Outlook.MailItem
Dim sRecipient As Outlook.Recipient
Dim CorrRecip As String
Dim DisableReplyToAll As VbMsgBoxResult
Dim i As Long

On Error Resume Next
Set CurrMail = ActiveInspector.CurrentItem

If CurrMail Is Nothing Then
' we might be in the explorer window
    If (ActiveExplorer.Selection.Count = 1) And (ActiveExplorer.Selection.Item(1).Class = olMail) Then
        Set CurrMail = ActiveExplorer.Selection.Item(1)
    End If
End If
On Error GoTo 0

If CurrMail Is Nothing Then
' either a mail msg is not open, or more than one email selected in explorer window, or no email selected at all, cannot set ref
    MsgBox "I was not able to forward an email. Please run this code ONLY under one of the following conditions:" & vbCr & vbCr & _
        "-- You are viewing a single email message." & vbCr & _
        "-- You are in your Inbox and have exactly one message selected.", vbInformation
    GoTo ExitProc
End If

Set NewFwd = CurrMail.forward

NewFwd.Display
' delete any "direct replies to" recipients of newly forwarded msg, usually zero
If (NewFwd.ReplyRecipients.Count > 0) Then
    For i = 1 To NewFwd.ReplyRecipients.Count
        NewFwd.ReplyRecipients.Remove (i)
    Next i
End If
' find out who the email should have gone to, and add them to 'To' field
    CorrRecip = InputBox("Who should this email have gone to?" & vbCr & vbCr & "Enter ONE email address, distribution list, or display name.")

DisableReplyToAll = MsgBox("Would you like to disable 'Reply To All'?", vbYesNo + vbDefaultButton1)
    Select Case DisableReplyToAll
        Case vbYes
            ActiveInspector.CurrentItem.Actions("Reply to All").Enabled = False
        Case Else
    End Select

With NewFwd
    ' add correct recipient as specified to the "direct replies to" option box, that way they get any replies if the original sender hits Ctrl-R
    .ReplyRecipients.Add (CorrRecip)
    ' add original sender & correct recipients to TO field
    .Recipients.Add(CurrMail.SenderEmailAddress).Type = olTo
    .Recipients.Add(CorrRecip).Type = olTo
    ' add original recipient(s) to CC field
    For Each sRecipient In CurrMail.Recipients
        Set sRecipient = .Recipients.Add(sRecipient.Name)
        With sRecipient
            .Type = olCC
            .Resolve
        End With
    Next sRecipient
'        If NewFwd.BodyFormat <> olFormatHTML Then
            NewFwd.HTMLBody = "<p>Hello " & Left$(CurrMail.SenderName, InStr(1, CurrMail.SenderName, " ") - 1) & "," & "<p>I think you sent this to the wrong distribution list. </p><p>I am redirecting to the appropriate parties and CC抜ng original recipients.</p><p>Thx all!</p>" & NewFwd.HTMLBody
'        Else
'            NewFwd.Body = "Hello " & Left$(CurrMail.SenderName, InStr(1, CurrMail.SenderName, " ") - 1) & "," & vbCr & "I think you sent this to the wrong distribution list." & vbCr & "I am redirecting to the appropriate parties and CC抜ng original recipients." & NewFwd.Body
'        End If
    .Recipients.ResolveAll
    .ReplyRecipients.ResolveAll
    .Display
    '.Send
End With

ExitProc:
Set CurrMail = Nothing
Set NewFwd = Nothing
Set sRecipient = Nothing
End Sub
[此贴子已经被作者于2008-6-4 3:05:14编辑过]

TA的精华主题

TA的得分主题

 楼主| 发表于 2008-8-4 16:33 | 显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助
谢谢!我在我的outlook里面做了尝试,但是发现该宏的功能使用outlook自身的功能就已经能够实现了。不过还是谢谢你!

TA的精华主题

TA的得分主题

发表于 2008-8-5 10:17 | 显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助

看了代码之后反而晕了,这不就是转发吗?

Set NewFwd = CurrMail.Forward

对于Redirect的意思还是不是很明白,希望楼主把自己的方法共享出来让大家学习一下

您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

关闭

最新热点上一条 /1 下一条

手机版|关于我们|联系我们|ExcelHome

GMT+8, 2024-4-20 18:35 , Processed in 0.046835 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 1999-2023 Wooffice Inc.

沪公网安备 31011702000001号 沪ICP备11019229号-2

本论坛言论纯属发表者个人意见,任何违反国家相关法律的言论,本站将协助国家相关部门追究发言者责任!     本站特聘法律顾问:李志群律师

快速回复 返回顶部 返回列表