Searching for an AppointmentItem by UserProperty

  • Thread starter Thread starter David C. Holley
  • Start date Start date
D

David C. Holley

I'm trying to write a procedure that will loop through the various
AppointmentItems in my Calendar folder looking for AI's that have a
specific value in a user defined property.

1. Is Outlook.MAPIFolder the preferred datatype to use when working with
my Calendar folder as an object?

Dim objOutlook As Outlook.Application
Dim nms As Outlook.NameSpace
Dim targetCalendar As Outlook.MAPIFolder

Set objOutlook = CreateObject("Outlook.application")
Set nms = objOutlook.GetNamespace("MAPI")
Set targetCalendar = nms.GetDefaultFolder(olFolderCalendar)

2. Can you please help me with the using the .Restrict method of the
..Items collection of the folder object? I have NEVER been able to
properly format the string. The specific items that I'm looking for will
have a value in a user defined property named dbAccessId. Hence I'm
looking for values that are not Null or a zero length string.
 
On Wed, 03 Aug 2005 16:59:41 -0400 David C. Holley wrote:

1. David, you can loop through the MapiFolder.Items collection or use the
Items.Restrict function.

2. The filter for string fields looks like this (note that the value must be
in quotas):
sFilter = "[Fieldname]=" & Chr(34) & sValue & Chr(34)
 
Thank you. I have now (almost) setup two-way updating between Outlook &
Access.
 
Back
Top