Hello Everyone,
I'm trying to create a task in Outlook from Excel. I've gotten pretty far in this code but I'm stuck with the start date.
Let me know your thoughts
I'm trying to create a task in Outlook from Excel. I've gotten pretty far in this code but I'm stuck with the start date.
Let me know your thoughts
Code:
Sub tasks()
Dim OutApp As Object
Dim myItem As Object
Dim Body1 As String
Const myTitle = "Enter data"
myPrompt = "Task content" & Chr(13) & "(describe what needs to be done)"
Body1 = InputBox(myPrompt, myTitle)
Set OutApp = CreateObject("Outlook.Application")
Set myItem = OutApp.CreateItem(olTaskItem)
With myItem
.StartDate = Now
.Subject = Selection.Cells(3) & Selection.Cells(5)
.DueDate = .StartDate + 1
.ReminderTime = .DueDate - 1
.Body = Body1
.Assign
.Display
End With
Set myItem = Nothing
Set OutApp = Nothing
End Sub