将多个与会者添加到会议邀请

我尝试了以下两种方式来添加多个与会者,但只有最后一个电子邮件地址在.To区域中陈述。

testing1: 失败

.RequiredAttendees = "me@me.com;" .RequiredAttendees = "you@you.com" 

testing2: 失败

  .RequiredAttendees = "me@me.com; you@you.com" 

以下是完整的代码:

 Sub MeetingInvite() Dim rng As Range Dim OutApp As Object Dim OutMail As Object With Application .EnableEvents = False .ScreenUpdating = False End With Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(1) On Error Resume Next With OutMail .RequiredAttendees = "me@me.com;" .RequiredAttendees = "you@you.com" .Subject = "Meeting" .Importance = True .Body = "Meeting Invite" & Format(Date) .Display End With Set OutMail = Nothing Set OutApp = Nothing Unload Emy End Sub 

该代码创build一个邀请,但我需要添加大约30个电子邮件地址。

您正在尝试更改RequiredAttendees。 该属性只包含所需参与者的显示名称。

与会者列表应通过使用收件人集合设置。 尝试这个:

 With OutMail .Recipients.Add ("me@me.com") .Recipients.Add ("you@you.com") .Subject = "Meeting" .Importance = True .Body = "Meeting Invite" & Format(Date) .Display End With 

或者,如果您想从工作表中阅读与会者:

 With OutMail For Each cell In Range("C2:C10") .Recipients.Add (cell.Value) Next cell .Subject = "Meeting" .Importance = True .Body = "Meeting Invite" & Format(Date) .Display End With 

当然,如果你真的想通过邮件邀请30个与会者,这可能是提前两天召开这个会议的明智之举,而不是今天邀请他们。