How to import outlook tasks in excel, via a code in excel vba?

 Question:

  Trying to develop an excel based tool, where I can import my outlook tasks in excel sheet through a vba code written in excel module, not in outlook?




 Answers: 



I think you mean appointment, not task, right. This script will do it for you.
Private Sub Add_Appointments_To_Outlook_Calendar()
'Include Microsoft Outlook nn.nn Object Library from Tools -> References
Dim oAppt As AppointmentItem
Dim Remind_Time As Double

i = 2
Subj = ThisWorkbook.Sheets(1).Cells(i, 1)

'Loop through entire list of Reminders to be added
While Subj <> ""
    Set oAppt = Outlook.Application.CreateItem(olAppointmentItem)

    oAppt.Subject = Subj
    oAppt.Location = ThisWorkbook.Sheets(1).Cells(i, 2)
    oAppt.Start = ThisWorkbook.Sheets(1).Cells(i, 3)
    Remind_Time = ThisWorkbook.Sheets(1).Cells(i, 4) * 1 * 60
    oAppt.ReminderMinutesBeforeStart = Remind_Time
    oAppt.AllDayEvent = True
    oAppt.Save

    i = i + 1
    Subj = ThisWorkbook.Sheets(1).Cells(i, 1)
Wend
MsgBox "Reminder(s) Added To Outlook Calendar"
End Sub
Your setup will look something like this.
enter image description here

Commentaires

Posts les plus consultés de ce blog

XAJAX with PHP – The future of web development

XAJAX with PHP – The future of web development

Database connection pooling in ADO.Net