Outlook 宏可以触发其内置导入功能吗?

发布于 2024-11-11 16:37:25 字数 178 浏览 1 评论 0原文

我正在尝试自动化 Outlook 以在启动时自动加载 iCalendar 文件 (.ics)。我已经知道需要使用哪些钩子来安排时间,我只是无法找到有关可能实现哪种自动化的高质量信息。

由于 Outlook 已经能够很好地导入 iCalendar 文件来满足我的目的,因此我更愿意触发该功能,而不是编写自己的解析代码。这可能吗?

I'm trying to automate Outlook to automatically load an iCalendar file (.ics) when it starts. I'm aware of the hooks I need to use to arrange the timing already, I just haven't been able to find quality information about what sort of automation is possible.

Since Outlook already has the ability to import iCalendar files well enough for my purposes, I'd prefer to trigger that functionality rather than write my own parsing code. Is that possible?

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

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

发布评论

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

评论(1

司马昭之心 2024-11-18 16:37:25

取决于你想要什么,答案是你做不到。

如果您想“导入”ics 文件,您无法单独完成,您需要例如兑换,请参阅此处 Visual Studio 论坛 因为 MS 经常移动链接,这里引用了那里的内容

“Outlook 没有使用代码将 ICS 文件导入日历项目的内置方法。然而,一个名为 Redemption (www.dimastr.com/redemption) 的第三方库确实具有这种能力。使用文件路径和项目类型调用 SafeAppointmentItem.Import 函数。因此,如果使用保存附件的文件路径和类型 7 (olVCal) 调用它,您就可以执行您想要的操作。 “ 原始链接为:http://groups.google.co.uk/group/microsoft.public.office.developer.outlook.vba/browse_thread/thread/e4656ad0c5b68b89/d356ce07aeae783d?hl=en&lnk=st&q=import+ .ics+file+into+outlook+by+codes#d356ce07aeae783d

那么你有什么选择或者你还能做什么。

首先,我假设您正在处理类似 application_startup 事件的事情。

您可以对文件进行“脱壳”——这与双击它具有相同的效果。

请参阅此处 带有示例的 MSDN shell 为此,您需要您的路径ics 文件。

但对于我来说,在你的立场上,我会首先尝试让生成 ics 文件的人或事物进行更改,或者我只是将其视为文本文件,解析信息(鉴于它是一个预期格式)并在 Outlook 中创建我自己的日历项目。

Depending on what you want, the answer is you cannot do it.

If you want to "import" the ics file you cannot do it alone, you would need for example redemption see here Visual Studio Forum Because MS moves their links often here is a quote from there

“Outlook has no built-in methods to import an ICS file into a calendar item using code. However, a 3rd party library called Redemption (www.dimastr.com/redemption) does have that ability. The SafeAppointmentItem.Import function is called with a file path and item type. So if it's called with the file path where you saved the attachment and a type of 7 (olVCal) you can do what you want. “ Original link is:http://groups.google.co.uk/group/microsoft.public.office.developer.outlook.vba/browse_thread/thread/e4656ad0c5b68b89/d356ce07aeae783d?hl=en&lnk=st&q=import+.ics+file+into+outlook+by+codes#d356ce07aeae783d

So what are you options or what else can you do.

First I assume you are working in something like the application_startup event.

you could "shell" the file - which would have the same effect as double clicking on it.

see here MSDN shell with examples For this you would need the path to your ics file.

But for me in your position, I would be first trying to get the person or thing generating the ics file to change OR I would be just treating it like a text file, parsing the information (which should not be too hard given it is an expected format) and creating my own calendar item in outlook.

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