Creating an appointment to a specific calendar. VBA outlook

ε祈祈猫儿з 提交于 2019-12-12 03:29:48

问题


How do i create a macro to create an appointment to another calendar. The current macro i am using creates to my default calendar. Thanks in advance.

Sub test()

Dim myItem As Object
Set myItem = Application.CreateItem(olAppointmentItem)
myItem.MeetingStatus = olMeeting
myItem.Subject = "Strategy Meeting"
myItem.Location = "Conf Rm All Stars"
myItem.Start = #4/11/2016 1:30:00 PM#
myItem.Duration = 10
myItem.Display

End Sub

回答1:


Call Application.Session.CreateRecipient, then pass the returned Recipient object to Application.Session.GetSharedDefaultFolder. You can then call MAPIFolder.Items.Add to add a new appointment.



来源:https://stackoverflow.com/questions/36538042/creating-an-appointment-to-a-specific-calendar-vba-outlook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!