[英]Excel 2010 VBA Outlook Email Sender Follow-up Tag
我創建了下面的代碼,該代碼自動向工作簿發送電子郵件,並且我希望在發送日期起2天之內以發件人的后續操作標記已發送的電子郵件,以提醒我在2天內進行后續操作。
我看過其他論壇都沒有成功,我發現的代碼只為接收者設置了標志。
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim SigString As String
Dim Signature As String
Dim wb As Workbook
Dim FileName As String
Dim wSht As Worksheet
Dim ShtName As String
Dim ws As Worksheet
ActiveWorkbook.SaveCopyAs ThisWorkbook.Path & "\" & "File Name " & Format(Now, "dd-mm-yy") & ".xlsm"
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.createitem(0)
strbody = " Please see the attached spreadsheet.
" & _"Please don't hesitate to contact me if you have any questions.
"
'Change only Mysig.htm to the name of your signature
SigString = Environ("appdata") & _
"\Microsoft\Signatures\Expediting Officer.htm"
If Dir(SigString) <> "" Then
Signature = GetBoiler(SigString)
Else
Signature = ""
End If
On Error Resume Next
With OutMail
.To = ""
.CC = ""
.BCC = ""
.Subject = ""
.HTMLBody = strbody & "
" & Signature
.display
.Attachments.Add ("File location"\"File Name " & Format(Now, "dd-mm-yy") & ".xlsm")
.display
.Importance = 2
End With
MailItem類提供以下屬性來完成工作:
請參見示例代碼:
Public Sub FlagMessage(Item As Outlook.MailItem)
With Item
.MarkAsTask olMarkThisWeek
' sets a due date in 48 hours
.TaskDueDate = Now + 2
.ReminderSet = True
.ReminderTime = Now + 2
.Save
End With
End Sub
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.