[英]Excel 2010 VBA Outlook Email Sender Follow-up Tag
I have created the below code which emails a workbook automatically and I would like to flag the sent email with a sender follow-up 2 days from the sent date to remind me to follow up the sent email in 2 days. 我创建了下面的代码,该代码自动向工作簿发送电子邮件,并且我希望在发送日期起2天之内以发件人的后续操作标记已发送的电子邮件,以提醒我在2天内进行后续操作。
I have looked at other forums without success and the code that I have found only sets the flag for the recipient. 我看过其他论坛都没有成功,我发现的代码只为接收者设置了标志。
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
The MailItem class provides the following properties to get the job done: MailItem类提供以下属性来完成工作:
See the sample code: 请参见示例代码:
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.