Adding / Editing a task in public folder

S

Steve Roberts

Is there a way to use VBA to add a task to a public folder? I found the code
for adding a task to the default task folder and that works fine but I can't
seem to find the solution wading through all of the stuff on the web. I also
need to know how to use the entryID to make changes to the task once it is
in the public folders. The name of the public folder will be static so a
hard coded path would be fine.

The goal here is for the users to create entries into an Access CRM database
and have that automatically create a local task for the user that entered
the item as well an entry in the Public Folder task list. The entryIDs would
be stored into the access database allowing for changes in the future.

Any suggestions or links to samples would be appreciated.

Thanks

Steve
 
S

Sue Mosher [MVP-Outlook]

To create a new item in a non-default folder, use the Add method on the target folder's Items collection. You can use the code at http://www.outlookcode.com/d/code/getfolder.htm to walk the folder hierarchy and return the MAPIFolder corresponding to a given path string.

You use the EntryID (and StoreID) with the Namespace.GetItemFromID method to return an item, based on knowing its ID.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
D

David C. Holley

I played with using the EntryId to locate an Item and decided to go with
a solution that put the recordId from my Access DB into a user-defineded
property. I still story the EntryId just for reference, but its the
recordID that finds and makes the changes.
 
S

Steve Roberts

David,

Why did you decide to do it that way? Did you have problems using the
entryID?
 
D

David C. Holley

I don't recall the full reasoning. But I know that part of it was to
change the philosophy regarding the AppointmentItems that I was creating
from within Access. The AppointmentItems represent reservations. Every
time the reservation is modified, Access reaches out to Outlook, deletes
all AppointmentItems, and creates a new one. (Basically, a cancel-rebook
approach as opposed to find the item and change it.) I realized that
sometimes the Access DB wasn't capturing the EntryId and so there were
multiple Items being created. The orginal approach was the if
IsNull(EntryId) = True then create the AppointmentItem. Now, Access
deletes any that exists (if any) and the creates them. Since the Access
DB is the system of record, I don't care if any changes in Outlook are
made. They're just overwriten. However, I do have code that runs in
Outlook that will update the record in Access if the date/time is changed.

David H
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top