I have an Outlook 2007 macro that sends an email with flag for recipient but it doesn't work anymore.
I made a change to the code by mistake and now it doesn't work anymore.
The recipient doesn't see the email in TO DO and it doesn't show red on the email list.
Sub fff()
Dim outApp As Object
Dim OutMail As Object
Dim datDue As Date
datDue = DateAdd("d", 7, Date)
Set OutMail = outApp.CreateItem(0)
With OutMail
.To = "me@yyy.com"
.Subject = "test"
.HtmlBody = "msg"
.Importance = olImportanceHigh
.FlagStatus = olFlagMarked
.FlagRequest = "Follow up"
.ReminderTime = datDue & " 17:00 PM"
.ReminderOverrideDefault = True
.ReminderSet = True
.TaskStartDate = Date
.TaskDueDate = datDue
.Save
.Send
End With
End Sub
答案 0 :(得分:2)
您的变量OutApp
并不有用,在Outlook中直接使用时,Application
应为Sub wittman()
Dim OutMail As MailItem
Dim datDue As Date
datDue = DateAdd("d", 7, Date)
Set OutMail = Application.CreateItem(0)
With OutMail
.To = "test@mail.com"
.Subject = "test"
.HTMLBody = "msg"
.Importance = olImportanceHigh
.FlagStatus = olFlagMarked
.FlagRequest = "Follow up"
.ReminderTime = datDue & " 17:00 PM"
.ReminderOverrideDefault = True
.ReminderSet = True
.TaskStartDate = Date
.TaskDueDate = datDue
.Save
.Send
End With 'OutMail
End Sub
。
我只测试该代码,它对我很有效(Outlook 2013):
func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, forType type: PKPushType) {
NSLog("pushRegistry:didReceiveIncomingPushWithPayload:forType:")
if (type == PKPushType.voIP) {
print(payload.dictionaryPayload)
VoiceClient.sharedInstance().handleNotification(payload.dictionaryPayload, delegate: self)
}
}
答案 1 :(得分:1)
您可以将任务发送给代理人:
Sub AssignTask()
Dim myItem As Outlook.TaskItem
Dim myDelegate As Outlook.Recipient
Set MyItem = Application.CreateItem(olTaskItem)
MyItem.Assign
Set myDelegate = MyItem.Recipients.Add("Eugene Astafiev")
myDelegate.Resolve
If myDelegate.Resolved Then
myItem.Subject = "Prepare Agenda for Meeting"
myItem.DueDate = Now + 30
myItem.Display
myItem.Send
End If
End Sub
在运行此示例之前,请不要忘记使用有效的收件人名称替换“Eugene Astafiev”。
此外,您可以使用MailItem类的MarkAsTask方法将MailItem
对象标记为任务,并为对象分配任务间隔。调用此方法会设置其他几个属性的值,具体取决于MarkInterval
中提供的值。有关通过指定MarkInterval设置的属性的更多信息,请参阅OlMarkInterval Enumeration。
您可能会发现How to set a flag to follow up using VBA文章有用。