如何在 MS Access 中将邮件从一个链接的 Exchange 邮箱移动到另一个

发布于 2024-07-04 17:29:35 字数 312 浏览 4 评论 0原文

我有一个作为 MS Access 应用程序中的表链接的 Exchange 邮箱。 这主要用于阅读,但我也希望能够将邮件“移动”到另一个文件夹。

不幸的是,这并不像在第二个链接邮箱中写入那么简单,因为显然我无法编辑某些字段。 某些关键字段(例如“收件人:”字段)不可用,因为我收到以下错误

“字段‘收件人’基于表达式且无法编辑”。

使用CreateObject("Outlook.Application ") 这里不是一个选项,因为据我所知,这会在从 Access 调用时提供一个安全对话框。

有什么解决办法吗?*

I have an Exchange mailbox linked as a table in an MS Access app. This is primarily used for reading, but I would also like to be able to "move" messages to another folder.

Unfortunately this is not as simple as writing in a second linked mailbox, because apparently I can not edit some fields. Some critical fields like the To: field are unavailable, as I get the following error

"Field 'To' is based on an expression and cannot be edited".

Using CreateObject("Outlook.Application") instead is not an option here, because as far as I know, this gives a security dialog when called from Access.

Any solutions?*

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

鹿港小镇 2024-07-11 17:29:35

这是两个问题吗? 可以使用 Move 方法移动邮件。 以下是一个片段:

 Set oApp = CreateObject("Outlook.Application")

Set oNS = oApp.GetNamespace("MAPI")

Set oMailItems = oNS.GetDefaultFolder(olFolderInbox)
Set itm = oMailItems.Items(6)
itm.Move oNS.GetDefaultFolder(olFolderDeletedItems)

但是,即使使用 Outlook 兑换,收件人(收件人)也是只读的。

Is this two problems? Mail can be moved using the Move method. Here is a snippet:

 Set oApp = CreateObject("Outlook.Application")

Set oNS = oApp.GetNamespace("MAPI")

Set oMailItems = oNS.GetDefaultFolder(olFolderInbox)
Set itm = oMailItems.Items(6)
itm.Move oNS.GetDefaultFolder(olFolderDeletedItems)

However, Recipients (To) is read only, even, I believe, with Outlook Redemtion.

坦然微笑 2024-07-11 17:29:35

我认为 Access 不是适合这项工作的工具。 您将无法避免使用 Outlook.Application 对象或 MAPI 包装器(如 CDO)。 CDO 将是更优雅、更高效的方式,但它必须通过 Office 安装程序显式安装在客户端上。

如果您想避免脚本安全对话框(以及一般的一些 CDO 不功能),您应该提供 Outlook Redemption尝试一下。

Redemption 是 CDO 的直接替代品,当您之前进行任何 CDO/Outlook VBA 编码时,您会立即熟悉它。

I don't think Access is the right tool for the job. You will not get around using an Outlook.Application object or a MAPI wrapper like CDO. CDO will be the more elegant and performant way, but it must explicitly be installed on the client via Office Setup.

If you want to avoid the script security dialog (and some of the CDO incapabilities in general), you should give Outlook Redemption a try.

Redemption is a drop-in replacement for CDO and you will be instantly familiar to it when you did any CDO/Outlook VBA coding before.

不顾 2024-07-11 17:29:35

要将电子邮件从一个链接的 Exchange 邮箱移动到 MS Access 中的另一个邮箱,请首先创建一个新表来存储电子邮件数据。 然后,使用 Outlook 对象模型从源邮箱检索电子邮件并将它们插入到新表中。 最后,再次使用 Outlook 对象模型将电子邮件发送到目标邮箱。

例如,如果您需要移动一系列电子邮件,其中包含有关如何执行pdf 幻灯片免费下载的信息,您可以从源邮箱中检索它们,将它们保存到新表中,然后将它们发送到目标邮箱以供进一步查看和共享。

To move emails from one linked Exchange mailbox to another in MS Access, first create a new table to store the email data. Then, use the Outlook object model to retrieve the emails from the source mailbox and insert them into the new table. Finally, use the Outlook object model again to send the emails to the destination mailbox.

For example, if you need to move a series of emails containing information on how to perform a pdf slides free download, you can retrieve them from the source mailbox, save them to the new table, and then send them to the destination mailbox for further review and sharing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文