【发布时间】:2020-07-25 17:59:57
【问题描述】:
我有一个在 Outlook 中创建约会的功能。我的问题是,它没有添加任何收件人。我使用 CheckedListBox 和仅使用字符串(硬编码)进行了尝试,但它不起作用。 约会本身已创建,但没有收件人..
这是我的代码:
Dim app As Microsoft.Office.Interop.Outlook.Application
Dim appt As Microsoft.Office.Interop.Outlook.AppointmentItem
app = New Microsoft.Office.Interop.Outlook.Application
appt = app.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olAppointmentItem)
appt.Subject = tbBetreff.Text
appt.Body = tbInhalt.Text
appt.Location = tbOrt.Text
For Each itemChecked In cbContacts.CheckedItems
Dim sentTo As Outlook.Recipients = appt.Recipients
Dim sentInvite As Outlook.Recipient
sentInvite = sentTo.Add(itemChecked.ToString())
sentInvite.Type = Outlook.OlMeetingRecipientType.olRequired
sentTo.ResolveAll()
Next
appt.Start = Convert.ToDateTime("24.07.2020 13:00:00")
appt.End = Convert.ToDateTime("24.07.2020 14:00:00")
appt.ReminderSet = True
appt.ReminderMinutesBeforeStart = 30
appt.Save()
你看到问题了吗? 谢谢。。
【问题讨论】: