问题
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