เพิ่มผู้เข้าร่วมประชุมหลายคนในการเชิญประชุม

ฉันพยายามเพิ่มผู้เข้าร่วมหลายคน แต่ระบุเฉพาะที่อยู่อีเมลสุดท้ายในพื้นที่ .ถึง

ทดสอบ 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 รายการ


person LivinLife    schedule 02.12.2017    source แหล่งที่มา
comment
.RequiredAttendees = "[email protected]; [email protected]" ได้ผลสำหรับฉัน   -  person Siddharth Rout    schedule 02.12.2017
comment
i.stack.imgur.com/Oi4hi.png   -  person Siddharth Rout    schedule 02.12.2017
comment
ขอบคุณ -- ให้ฉันทดสอบมากกว่านี้แล้วกลับมาใหม่ ฉันขอขอบคุณการยืนยัน ตกลง สามารถเพิ่มอีเมลได้สูงสุดกี่ฉบับ?   -  person LivinLife    schedule 02.12.2017
comment
MSDN ระบุว่าคุณควรใช้แบบฟอร์มที่คุณใช้ในการทดสอบ 2 และยังระบุด้วยว่าสิ่งเหล่านี้เป็นเพียงชื่อที่แสดง และคุณควรใช้คอลเลกชัน Recipients msdn.microsoft.com/en- เรา/VBA/Outlook-VBA/articles/   -  person NickSlash    schedule 02.12.2017
comment
is there a maximum number of emails I can add? ดู สิ่งนี้   -  person Siddharth Rout    schedule 02.12.2017
comment
ฉันใช้ผู้รับเพื่อสร้างอีเมลจำนวนมาก ฉันจะดูสิ่งนี้ แต่ .RequiredAttendees = [email protected]; [email protected] ไม่สามารถทำงานร่วมกับคนหลายคนได้   -  person LivinLife    schedule 03.12.2017
comment
จริงๆ แล้วฉันพบวิธีที่มีประสิทธิภาพมากขึ้นในการเพิ่มอีเมลภายในสมุดงานที่ใช้งานอยู่ ฉันได้ลองกำหนดค่าบางอย่างแล้ว: Set myRecipient = .Recipients.Add(Range(C2)) แต่ไม่ได้ดึงมากกว่าเซลล์แรก ตัวอย่างเช่น Set myRecipient = .Recipients.Add(Range(C2:C10)) ไม่สามารถดึงที่อยู่อีเมลทั้งหมดได้ นี่จะดึงเฉพาะอันแรกเท่านั้น   -  person LivinLife    schedule 03.12.2017


คำตอบ (1)


คุณกำลังพยายามเปลี่ยน 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 คนทางไปรษณีย์จริงๆ ก็ควรกำหนดเวลาการประชุมล่วงหน้าสองสามวัน แทนที่จะเชิญพวกเขาสำหรับวันนี้ ...

person Peter Pesch    schedule 03.12.2017