本文介绍了MS Outlook 2010 .SenderEmailAddress 返回一大串字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经搜索并搜索了答案,所以我会在这里发布.我正在尝试创建一个宏,将 2 周前的邮件从我的收件箱移动到我为每个同事创建的特定文件夹.宏成功循环所有超过两周的收件箱邮件.但是,当我使用 .SenderEmailAddress 时,它会返回一大串字符,而不是 ###@####.com.我如何只获取发件人的电子邮件地址?

I've searched and searched for an answer so I'll post this here. I'm trying to create a macro that will move 2 week old messages from my inbox to a specific folder I created for each of my coworkers. The macro successfully loops though all inbox message older than two weeks. However, when I use the .SenderEmailAddress it retuns a huge string of characters instead of ###@####.com. How do I just get the senders email address?

没有给出确切的字符串(安全问题),这是我用X"代替某些字符得到的结果:

Without giving the exact string (security issue), here is what I get with "X"'s in place of some characters:

/o=XXXXXXX/ou=Exchange Administrative Group (XXXXXXXXXXXXXXX)/cn=Recipients/cn=XXXXX@XXXXX

字符串的末尾是主题行文本.

At the end of the string is the Subject line text.

任何帮助将不胜感激!:-)

Any help would be greatly appreciated! :-)

推荐答案

这是一个完全有效的 EX 类型地址(与 SMTP 相对).

This is a perfectly valid EX type address (as opposed to SMTP).

尝试使用 MailItem.Sender.GetExchangeUser().PrimarySmtpAddress.

Try to use MailItem.Sender.GetExchangeUser().PrimarySmtpAddress.

您当然需要检查空值/错误,以防发件人不是 Exchange 用户或无法检索地址.

You will need to check for nulls/errors of course in case the sender is not an Exchange user or if the address cannot be retrieved.

这篇关于MS Outlook 2010 .SenderEmailAddress 返回一大串字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 11:44