excel - 使用 Excel 发送 Outlook 会议邀请
问题描述
我希望为工作表中的每一行发送会议邀请。
我可以创建一个显示为约会的项目,而不是可以发送给其他人的会议请求。我需要在 Outlook 中单击“邀请与会者”,然后显示电子邮件地址,我可以发送,但如果我有超过几行,则需要很长时间。
这似乎是一个常见问题,因为我在其他论坛中发现了这个问题,但没有一个对我有用的解决方案。
Sub SendAction()
Dim OutApp As Object
Dim OutMail As Object
Dim cell As Range
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
For Each cell In Worksheets("Action Log").Range("H5:H50").Cells
Set OutMail = OutApp.CreateItem(1)
If cell.Value Like "*@*" Then 'try with less conditions first
With OutMail
.MeetingStatus = olMeeting
.RequiredAttendees = Cells(cell.Row, "H").Value
.Subject = Cells(cell.Row, "I").Value
.Body = Cells(cell.Row, "I").Value
.Start = Cells(cell.Row, "E").Value & " " & TimeValue("8:00 AM")
.Location = "Your Office"
.Duration = 15 ' 15 minute meeting
.BusyStatus = 0 ' set as free
.ReminderSet = True 'reminder set
.ReminderMinutesBeforeStart = "20160" 'reminder 2 weeks before
.display
End With
Cells(cell.Row, "K").Value = "sent"
Set OutMail = Nothing
End If
Next cell
Application.ScreenUpdating = True
End Sub
这是我尝试过的一种替代方法,但没有解决问题:
Application.Wait DateAdd("s", 2, Now) 'waiting for 2 sec to let OL window to display.
SendKeys "%s", True 'Sending Mail.
Set olApt = Nothing
MsgBox "Invite Sent", vbInformation
来源:https ://excel-buzz.blogspot.com/2015/03/automation-sending-invitation-to.html
另一种选择是更改.Display
为,.Save
但.Send
无论哪种方式,该功能都不起作用,然后我需要从 Outlook 中的草稿邮件中打开会议请求。
解决方案
试试这个?
子发送动作()
Dim OutApp As Object
Dim OutMail As Object
Dim cell As Range
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
For Each cell In Worksheets("Action Log").Range("H5:H50").Cells
Set OutMail = OutApp.CreateItem(1)
If cell.Value Like "*@*" Then 'try with less conditions first
With OutMail
.MeetingStatus = olMeeting
.RequiredAttendees = Cells(cell.Row, "H").Value
.RequiredAttendees.Type = olRequired
.Subject = Cells(cell.Row, "I").Value
.Body = Cells(cell.Row, "I").Value
.Start = Cells(cell.Row, "E").Value & " " & TimeValue("8:00 AM")
.Location = "Your Office"
.Duration = 15 ' 15 minute meeting
.BusyStatus = 0 ' set as free
.ReminderSet = True 'reminder set
.ReminderMinutesBeforeStart = "20160" 'reminder 2 weeks before
.display
.send
End With
Cells(cell.Row, "K").Value = "sent"
Set OutMail = Nothing
End If
Next cell
Application.ScreenUpdating = True
结束子
推荐阅读
- c# - 为什么只创建了一张表?
- css - wordpress中的英雄图像背景没有将它的孩子放在里面
- ruby - 在 ruby 中使用 octokit 在 github 中检索最新的发布版本和最后 3 个各自的提交
- c# - C# Web Api - Salesforce - 如何通过 api 调用而不是通过浏览器获取身份验证代码
- android - 如何在不中断振铃的情况下更新现有的振铃通知?
- python - 找到“Y”行时如何删除“X”行
- node.js - 如何从 cli 使用 rimraf 删除构建文件夹但不删除“构建”文件夹本身
- ios - 在不支持并发的函数中调用'async' swift ios Xcode async/await
- mysql - 如何在此处添加 SQL 列值
- angular - “无效的工作区:。错误:在所选目录中找不到配置文件:。”