2017-12-02 202 views
1

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

测试1:失败

.RequiredAttendees = "[email protected];" 

    .RequiredAttendees = "[email protected]" 

测试2:失败

.RequiredAttendees = "[email protected]; [email protected]" 

以下是完整代码:

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 = "[email protected];" 
    .RequiredAttendees = "[email protected]" 
    .Subject = "Meeting" 
    .Importance = True 
    .Body = "Meeting Invite" & Format(Date) 
    .Display 
End With 

Set OutMail = Nothing 
Set OutApp = Nothing 
Unload Emy 
End Sub 

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

+0

'.RequiredAttendees =“[email protected]; [email protected]”'适合我 –

+0

https://i.stack .imgur.com/Oi4hi.png –

+0

谢谢 - 让我再测试一下,然后回来。我很欣赏这个确认。 Byc hance,是否有最大数量的电子邮件可以添加? – LivinLife

回答

0

您正在尝试更改RequiredAttendees。此属性仅包含所需参加者的显示名称。

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

With OutMail 
    .Recipients.Add ("[email protected]") 
    .Recipients.Add ("[email protected]") 
    .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人,这可能是明智的安排那会议提前几天,而不是今天邀请他们...

相关问题