[英]Using Excel to Send Appointments/Meetings with Attendees on Outlook
what I have running currently only sends myself the meeting.我目前正在运行的只是向自己发送会议。 I tried doing xOutItem.Send rather than xOutItem.Save and get an error.我尝试做 xOutItem.Send 而不是 xOutItem.Save 并得到一个错误。 I have an attendee email on H2, but they don't receive the message on their calender.我在 H2 上有一封与会者电子邮件,但他们没有在日历上收到消息。 Any tips/help is greatly appreciated.非常感谢任何提示/帮助。 Thank you in advance.先感谢您。
Sub AddAppointments()
Dim I As Long
Dim xRg As Range
Dim xOutApp As Object
Dim xOutItem As Object
Set xOutApp = CreateObject("Outlook.Application")
Set xRg = Range("A2:H2:A3:H3")
For I = 1 To xRg.Rows.Count
Set xOutItem = xOutApp.CreateItem(1)
Debug.Print xRg.Cells(I, 1).Value
xOutItem.Subject = xRg.Cells(I, 1).Value
xOutItem.Location = xRg.Cells(I, 2).Value
xOutItem.Start = xRg.Cells(I, 3).Value
xOutItem.Duration = xRg.Cells(I, 4).Value
If Trim(xRg.Cells(I, 5).Value) = "" Then
xOutItem.BusyStatus = 2
Else
xOutItem.BusyStatus = xRg.Cells(I, 5).Value
End If
If xRg.Cells(I, 6).Value > 0 Then
xOutItem.ReminderSet = True
xOutItem.ReminderMinutesBeforeStart = xRg.Cells(I, 6).Value
Else
xOutItem.ReminderSet = False
End If
xOutItem.Body = xRg.Cells(I, 7).Value
xOutItem.RequiredAttendees = xRg.Cells(I, 8).Value
xOutItem.Save
Set xOutItem = Nothing
Next
Set xOutApp = Nothing
End Sub
The AppointmentItem.RequiredAttendees property returns a semicolon-delimited string of required attendee names for the meeting appointment. AppointmentItem.RequiredAttendees属性返回以分号分隔的会议约会所需与会者姓名字符串。 This property only contains the display names for the required attendees.此属性仅包含所需与会者的显示名称。 The attendee list should be set by using the Recipients
collection.应使用Recipients
集合设置与会者列表。
You may find the How To: Fill TO,CC and BCC fields in Outlook programmatically article helpful.您可能会发现如何:以编程方式填写 Outlook 中的收件人、抄送和密件抄送字段一文很有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.