Outlook 2003 VBA 在发送时检测所选帐户
是否可以通过 Outlook 2003 的 Application_ItemSend VBA 函数检测电子邮件正在发送给哪个帐户?这些帐户是独立计算机上的 POP3/SMTP,而不是基于 MAPI 或 Exchange。
我尝试过使用“Outlook Redemption”(http://www.dimastr.com/redemption/),但我找不到任何属性/方法来告诉我电子邮件是通过哪个帐户发送的。
我不需要能够修改/选择发送的帐户,只需简单地检测即可。
Is it possible to detect which account an email is being sent via the Application_ItemSend VBA function of Outlook 2003? The accounts are POP3/SMTP on a standalone machine, and not MAPI or Exchange based.
I have tried using "Outlook Redemption" (http://www.dimastr.com/redemption/) but I just cannot find any property / method that will tell me which of the accounts the email is being sent through.
I don't need to be able to amend/select the account being sent from, just simply detect.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我找到了一种查找帐户名称的方法,感谢 此链接,它提供了用于选择特定帐户的代码。
使用此代码作为基础,我创建了一个简单的 GetAccountName 函数,该函数完全按照我需要的方式执行。
编辑:仅当您不使用 Word 作为编辑器时,以下内容才有效。
I have found a way of finding the account name, thanks to this link which provides the code for selecting a particular account.
Using this code as a base, I have create a simple GetAccountName function, which is doing exactly what I need it to do.
Edit: The below will only work if you're NOT using Word as the editor.
这是一个尝试:
这将为您提供当前发送帐户的显示名称。
如果这还不够,您可以尝试
Item.sendUsingAccount
变量的其他属性。Here is a try:
This will give you the display name of the current sending account.
If that's not enough, you can try the other properties of the
Item.sendUsingAccount
var.在 Outlook 2003 中,您需要使用 Redemption 中的 RDOMail 对象来访问邮件项目的 Account 属性。下面是一些代码,用于将发件箱中所有项目的 SendAccount 从默认帐户更改为 OL 配置文件中的另一个帐户。可以通过编写一个帐户选择子例程来改进它,该子例程读取 OL 配置文件中的帐户并将它们显示为列表供用户选择。在提供的代码中,新的发送帐户是硬编码的。
In Outlook 2003, you need to use the RDOMail object in Redemption to access the Account property of a mail item. Here is some code that changes the SendAccount from the default account to another account in the OL Profile, for all items in the Outbox. It could be improved by coding an account selection subroutine that reads the accounts in the OL Profile and presents them as a list for the user to select from. In the code provided the new send account is hard-coded.