Experts Exchange Solution brought to you by
"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.
Dim MyOutlook As Outlook.Application
Dim objTask As TaskItem
Dim NS As NameSpace
Dim NoA As Long, i As Long
NoA = Cells(65536, 1).End(xlUp).Row
Set MyOutlook = New Outlook.Application
Set NS = MyOutlook.GetNamespace("MAPI")
Set MyFolder = NS.Folders("Personal Folders").Folders("Tasks")
Set myItems = MyFolder.Items
'Delete all the items in the "Tasks" folder
For i = MyFolder.Items.Count To 1 Step -1
'Add new items to the "Tasks" folder
For i = 2 To NoA
Set objTask = myItems.Add(olTaskItem)
.Subject = Cells(i, 1)
.DueDate = Cells(i, 2)
.ReminderSet = True
.ReminderTime = Cells(i, 3)
Set objContact = Nothing
Set NS = Nothing
Set MyFolder = Nothing
Set myItems = Nothing
Set MyOutlook = Nothing
Open in new window
Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.