ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   create outlook task from excel (https://www.excelbanter.com/excel-programming/404793-create-outlook-task-excel.html)

Albert

create outlook task from excel
 
Hi Guys,

Can someone give me the correct code to create an outlook task from excel?

Thanks
Albert

ryguy7272

create outlook task from excel
 
Used these before, but can't test now because something in my Outlooks seems
to be corrupt. Try all three; I believe at least one will work for you:

Sub CreateTask()
Dim objApp As Outlook.Application
Dim objTask As Outlook.TaskItem

Set objApp = CreateObject("Outlook.Application")
Set objTask = objApp.CreateItem(olTaskItem)
With objTask
.Subject = "Subject"
.StartDate = CDate(ProximaFechaAcumulada) - CDate(15)
.DueDate = CDate(ProximaFechaAcumulada)
.Importance = olImportanceHigh

.Body = "Body" 'Here I need Right to Left

.Save
.ReminderSet = True
End With
End Sub


Sub AddTaskToOutlook()
Dim objOutlook As Object
Dim objTask As Object
Dim NextStep As String
Dim ProjName As String
Dim cell As Range
Const olTaskItem = 3

'Get the data
NextStep = Range("C1")
ProjName = Range("C2")

' Set objOLapp = CreateObject("Outlook.Application", "localhost")

Set objOutlook = CreateObject("Outlook.Application")
Set objTask = objOutlook.CreateItem(olTaskItem)

objTask.Subject = NextStep
objTask.Save

Set objOutlook = Nothing
Set objTask = Nothing

End Sub


Sub GeneratingTaskInOutlook()
Dim objApp As Object
Dim OutTask As Object

Set objApp = CreateObject("Outlook.Application")
Set OutTask = objApp.CreateItem(olTaskItem)
With OutTask


.StartDate = Date
.DueDate = GetNextDay(Date, 1)
.Importance = olImportanceHigh
.Display
.ReminderSet = True
End With
End Sub


Regards,
Ryan---


--
RyGuy


"Albert" wrote:

Hi Guys,

Can someone give me the correct code to create an outlook task from excel?

Thanks
Albert



All times are GMT +1. The time now is 10:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com