I need to mark a message from a process in Excel using VBA. I create the message from Excel with everything necessary, sender, destinatary, subject, message and attachments. I have been looking for how to mark the message as a task, I understand that I cannot execute MarkAsTask until I have sent the message.
Sub CreateMailWithRemander()
Dim OutlookApp As Outlook.Application
Dim MyMessageItem As Outlook.MailItem
Set OutlookApp = New Outlook.Application
Set MyMessageItem = OutlookApp.CreateItem(olMailItem)
With MiMensaje
.Display
'.ReminderSet = True
.ReminderPlaySound = True
.TaskSubject = "Mi seguimiento"
.Display
'.MarkAsTask olMarkNextWeek 'Here I need set the date and hour for the remandir only for me.
'InsertBodyTextInWordEditor MiMensaje
'EnumerateItemProperties MiMensaje 'esto imprime todas los nombres de propiedad del objeto
'.Close olDiscard
End With
Set MyMessageItem = Nothing
Set OutlookApp = Nothing
End Sub
I tested with ‘ReminderTime and FlagDueBy but not is valid for this.
What I need is to see if there is any way to simulate what is done when opening a new message and selecting Tracking-Customize, marking the Notice check, putting a date within 7 days and the time at 9:00 and clicking OK.
I need to do exactly the same thing that Outlook does when it says that “After sending the message, it will be marked with the following information (the text in the screenshot is in Spanish because my computer has the system in Spanish):
Follow-up. It begins on Saturday, May 18, 2024. Expires Sunday, May 19, 2024. Notice: Monday, May 20, 2024 9:00
I cannot send the message directly since it must be reviewed and personalized, but I do need this part to be made automatic since it is very repetitive and is always the same.
Is there any way other than sending the message?
VBA code for mark mail remainder tak only for me before save while displaying mail