Hello All,
I am experimenting with generating emails from and excel form.
default mail program is outlook. what I want to do is add a follow-up flag to the email that has a due-date of two days past the current date
here is the send mail method i use
Private Sub FlaggedEmail_Click()
Dim MyApp As Boolean
Dim olApp As Object
Dim olEmail As Object
'Outlook constants aren't available using late binding
Const olMailItem = 0
'Open or Start a new instance of Outlook
On Error Resume Next
Set olApp = GetObject(, "Outlook.Application")
If Err.Number <> 0 Then
MyApp = True
Set olApp = CreateObject("Outlook.Application")
End If
olApp.Session.Logon
'Create an Outlook Mail Item
Set olEmail = olApp.CreateItem(olMailItem)
With olEmail
.To = "Ron Weasley"
.Subject = "hullo"
.Body = "your hogwarts stuff is ready
.Importance = 2
.display
End With
End Sub
I tried this method with the "With olEmail" portion. But it didn't work
.ReminderSet = True
.ReminderTime = DateAdd("m", 2, Now) ' Set to remind us 2
' minutes from now.
.DueDate = DateAdd("m", 5, Now) ' Set the due date to
' 5 minutes from now.
also, if you know of a list of other properties of outlook emails that can be set via vba, that would just be...killer.
Bookmarks