Searching for an AppointmentItem by UserProperty

  • Thread starter David C. Holley
  • 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.
 
M

Michael Bauer

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)
 
D

David C. Holley

Thank you. I have now (almost) setup two-way updating between Outlook &
Access.
 

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