Unable to use EntryId with RESTRICT

D

David C. Holley

I've created a sub that successfully creates an AppointmentItem in
Outlook from Access. The sub captures the EntryId of the AppointmentItem
and saves it to the record. Now, I'm trying to write a sub that takes
the EntryId and uses it to delete or modify the AppointmentItem. The
problem that I'm having is that statement that I'm trying to use returns
the error message "THE PROPERTY "EntryId" IN THE CONDITION IS NOT VALID".

Set test = mailbox.Folders("Calendar").Items.Restrict("[EntryId] =
'000000003FDF81AC3C66094A9F4987D7E8C181E7A4522100'")

The Outlook AppointmentItem DOEST exist. The specific EntryID IS correct
and will be replaced with a reference to a form field.

Ideas?

David H
 
S

Sue Mosher [MVP-Outlook]

If you looked up Restrict in Help, you'd quickly learn that EntryID is one of the fields you can't use. Instead, you should be using the Namespace.GetItemFromID method.
 
S

Sue Mosher [MVP-Outlook]

That's rather short-sighted, don't you think, given how many code snippets are there, along with descriptions on the limitations of different methods.
 

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