How to add a task item to an outlook public folder with vba macro / vbscript?

Joe Patrick

New Member
Joined
May 15, 2011
Messages
44
Hi!

I have this code to add a task to my personal outlook task list but how do I modify it to add the item to a public outlook task list?

Code:
Sub test()

Const olTaskItem = 3
Set objOutlook = CreateObject("Outlook.Application")
Set objTask = objOutlook.CreateItem(olTaskItem)
With objTask
    .Subject = "testsubject"
    .Body = "testbody"
    .ReminderSet = True
    .ReminderTime = #10/10/2005 12:00:00 PM#
    .DueDate = #10/31/2011 12:00:00 PM#
    .ReminderPlaySound = True
    .ReminderSoundFile = "C:\Windows\Media\Ding.wav"
End With

objTask.Save

End Sub

There are also multiple task lists in our public folders so I need to specify which task list it goes to.

Thank you!
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Happy Monday! I'm hoping someone will see this not that the work week has begun. I appreciate any help you can provide!
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,248
Members
452,900
Latest member
LisaGo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top