Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2008

Tip: Looking for answers? Try searching our database.

create outlook task from excel

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Albert - 23 Jan 2008 01:31 GMT
Hi Guys,

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

Thanks
Albert
ryguy7272 - 23 Jan 2008 21:44 GMT
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---

Signature

RyGuy

> Hi Guys,
>
> Can someone give me the correct code to create an outlook task from excel?
>
> Thanks
> Albert
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.