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.
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()Your setup will look something like this.
End Sub'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"
Commentaires
Enregistrer un commentaire