Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / October 2005

Tip: Looking for answers? Try searching our database.

Adding / Editing a task in public folder

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve Roberts - 25 Oct 2005 19:41 GMT
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


Sue Mosher [MVP-Outlook] - 25 Oct 2005 20:25 GMT
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.
Signature

Sue Mosher, Outlook MVP
  Author of Configuring Microsoft Outlook 2003
    http://www.turtleflock.com/olconfig/index.htm
  and Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

> 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
[quoted text clipped - 13 lines]
>
> Steve
David C. Holley - 25 Oct 2005 21:17 GMT
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.

> 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.
Steve Roberts - 25 Oct 2005 21:24 GMT
David,

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

>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
[quoted text clipped - 8 lines]
>> You use the EntryID (and StoreID) with the Namespace.GetItemFromID method
>> to return an item, based on knowing its ID.
David C. Holley - 26 Oct 2005 03:12 GMT
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

> David,
>
[quoted text clipped - 13 lines]
>>>You use the EntryID (and StoreID) with the Namespace.GetItemFromID method
>>>to return an item, based on knowing its ID.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.