Link to home
Start Free TrialLog in
Avatar of HelpMePlease777
HelpMePlease777

asked on

Adding an Task Item to a public folder with VBA

 I have a section of code that will add a task to a give users task list in outlook..... but I can not figure out how to add the same task to a task list in a public folder.  I need the task to be added to:  "Public Folders\All Public Folders\ProjectTest".   Any help would be greatly appreciated.  Thanks.
Dim objoutlook As Object
    Dim oNameSpace As Object
    Dim oSpDesk As Object
    Dim oFolder As Object
    Dim objtask As Object
    
     Set objoutlook = CreateObject("Outlook.Application")

    Set oNameSpace = objoutlook.GetNamespace("MAPI")
    Set oSpDesk = oNameSpace.CreateRecipient("Blow, Joe")
    Set oFolder = oNameSpace.GetSharedDefaultFolder(oSpDesk, 13)   '13 = olFolderTasks
    Set objtask = oFolder.Items.Add
        objtask.Subject = "Flow Test"
        objtask.DueDate = CDate("12/30/2009")
        objtask.ReminderSet = True
    objtask.Save

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of HelpMePlease777
HelpMePlease777

ASKER

Thanks
You're welcome.  Happy New Year!