我使用以下代码,但我只在主邮件帐户中注册了约会,我想知道可以在另一个Outlook帐户中注册直接约会:
.Recipients.Add("Roger Harui")
Dim sentTo As Outlook.Recipients = .Recipients
Dim sentInvite As Outlook.Recipient
sentInvite = sentTo.Add("Holly Holt")
sentInvite.Type = Outlook.OlMeetingRecipientType.olRequired
答案 0 :(得分:0)
Send
方法使用为会话指定的默认帐户发送项目。
Private Sub CreateMeeting()
Dim appt As Outlook.AppointmentItem = _
CType(Application.CreateItem( _
Outlook.OlItemType.olAppointmentItem), Outlook.AppointmentItem)
appt.Subject = "Customer Review"
appt.MeetingStatus = Outlook.OlMeetingStatus.olMeeting
appt.Location = "36/2021"
appt.Start = DateTime.Parse("19/04/2017 10:00 AM")
appt.End = DateTime.Parse("19/04/2017 11:00 AM")
Dim recipRequired As Outlook.Recipient = _
appt.Recipients.Add("Ryan Gregg")
recipRequired.Type = _
Outlook.OlMeetingRecipientType.olRequired
Dim recipOptional As Outlook.Recipient = _
appt.Recipients.Add("Peter Allenspach")
recipOptional.Type = _
Outlook.OlMeetingRecipientType.olOptional
Dim recipConf As Outlook.Recipient = _
appt.Recipients.Add("Conf Room 36/2021 (14) AV")
recipConf.Type = _
Outlook.OlMeetingRecipientType.olResource
appt.Recipients.ResolveAll()
appt.Send()
End Sub
有关详细信息,请参阅How to: Specify Different Recipient Types for an Appointment Item。