gpt4 book ai didi

vba - VBA,Outlook,看到“人民日历”

转载 作者:行者123 更新时间:2023-12-04 18:33:28 31 4
gpt4 key购买 nike

我想通过编程(使用VBA)访问其他人与我共享的日历。它们在我的Outlook中的“人民日历”下列出。我在网上搜索了此内容,所有建议所做的仅使我感到困惑。如何从“人的日历”中获取共享给我的所有日​​历的列表,然后具体列出一个日历?

最佳答案

从以下代码中检查返回的值。它按名称搜索人员,就像您在新电子邮件中键入收件人一样,然后抓取人员共享的日历并枚举所有共享的约会。

Dim _namespace As Outlook.NameSpace
Dim _recipient As Outlook.Recipient
Dim calendarFolder As Outlook.Folder

Set _namespace = Application.GetNamespace("MAPI")
Set _recipient = _namespace.CreateRecipient(name)
_recipient.Resolve

If _recipient.Resolved Then
Set calendarFolder = _namespace.GetSharedDefaultFolder(_recipient, olFolderCalendar)
'This would display the calendar on the screen:
'calendarFolder.Display

Dim oItems As Outlook.Items
Set oItems = calendarFolder.Items
'oItems is now a set of all appointments in that person's calendar
'Play on
End if

关于vba - VBA,Outlook,看到“人民日历”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5622477/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com