所以,我一直在为WAY这个任务摔跤太久了。我正在尝试创建一个预约并将其发送给某人的按钮。到目前为止,我已经成功地创建了我想要的变量,但我无法弄清楚如何将它发送给合适的人。或者为此发送它。我很新的内VBA的Outlook应用程序,所以,请温柔和我在一起,但这里是我到目前为止的代码:发送预约VBA
Sub appt()
Dim OutApp As Object
Dim OutMail As Object
Dim duedate As String
Dim currentrow As String
Dim currentsheet As String
Dim owner As String
currentsheet = ActiveSheet.Name
currentrow = Range("C10:C" & Rows.Count).Cells.SpecialCells(xlCellTypeBlanks).Row
duedate = Range("C" & currentrow).Offset(0, 1)
owner = Range("C" & currentrow).Offset(0, 2)
With Application
.EnableEvents = False
.ScreenUpdating = False
End With
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(1)
On Error Resume Next
With OutMail
.Recipients = Range("M3")
.Subject = "Next PDB Task for " & currentsheet
.Importance = True
.Start = "8:00 AM" & duedate
.End = "8:00 AM" & Format(Date + 5)
.ReminderMinutesBeforeStart = 10080
.Body = "Text and Stuff"
.Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
Unload Emy
End Sub
所以,这绝对是抓住我从它的运行在纸张想要的信息,但是它不会去任何地方。我需要使用除.Recipients之外的其他东西吗?是否有可能转发此(与.Forward也许?)?任何帮助将不胜感激!!!
P.S.我想要发送约会的电子邮件地址在单元格M3中。
哪里'Send'命令?此外,你说它不会在最上面的段落中找到合适的人,但是接下来说它绝对会抓取你想要的信息。它是否正确填写电子邮件,只是没有发送? – BruceWayne
outMail.to =范围(“m3”) –
没有发送命令。我需要一个吗?这不是创建一个邮件项目,只是在我的屏幕上打开一个约会。它从表格中提取正确的信息来填写appt宏,这就是我的意思。 - 去BruceWayne – ladymrt