Excel VBA在其他人的日历中创建约会 [英] excel vba create appointment in someone elses calendar
问题描述
当我打开Outlook时,我共享了大约10个日历.我具有要在Excel中进行的约会的所有信息,但是我不知道如何将其分配给我共享的日历之一.如何参考别人的日历,并在其中进行约会?
I have about 10 calendars shared when I open Outlook. I have all the information about the appointment I want to make in Excel, But I don't know how to assign it to one of the calendars that I share. How do I reference someone else's calendar, and put an appointment into it?
谢谢
推荐答案
H,
GetSharedDefaultFolder 方法Namespace类的ID返回一个Folder对象,该对象代表指定用户的指定默认文件夹.例如:
The GetSharedDefaultFolder method of the Namespace class returns a Folder object that represents the specified default folder for the specified user. For example:
Sub ResolveName()
Dim myNamespace As Outlook.NameSpace
Dim myRecipient As Outlook.Recipient
Dim CalendarFolder As Outlook.Folder
Set myNamespace = Application.GetNamespace("MAPI")
Set myRecipient = myNamespace.CreateRecipient("Dan Wilson")
myRecipient.Resolve
If myRecipient.Resolved Then
Call ShowCalendar(myNamespace, myRecipient)
End If
End Sub
Sub ShowCalendar(myNamespace, myRecipient)
Dim CalendarFolder As Outlook.Folder
Set CalendarFolder = _
myNamespace.GetSharedDefaultFolder _
(myRecipient, olFolderCalendar)
CalendarFolder.Display
End Sub
如何:创建新的Outlook约会项目文章介绍了如何在文件夹中创建约会.
The How To: Create a new Outlook Appointment item article describe how to create an appointment in the folder.
这篇关于Excel VBA在其他人的日历中创建约会的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!