所以,我一直在爲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