Suppressing code execution (was Entry ID question)

J

Jeff Mowatt

Is there a way to prevent code associated with an Outlook form from
executing when I read it in a collection, or to bypass such items.

Here's my problem. I'm only interested in the items which are recurrences of
the appointment item I have just stored by using Item.Save in my custom
OL2000 form.

I can't restrict the collection to those items because it's not allowable,
so I must read many more appointments, some of which have their own custom
forms and associated code.

I can see from those that have been created by unpublished forms, that
Outlook will attempt to execute the code as any item is read whih must make
my own code unpredictable to say the least.

Maybe there's a trick I'm missing? Outlook custom forms are proving to be
rather exasperating when one encounters methods with restrictions that
aren't mentioned in what Microsoft publishes on-line. Where does this
information come from other than these newsgroups I wonder?

Knowledge Base Article - 201101 describes what appears to be a solution to
my problem but I can see that it won't work because it assumes that no
appointments other than my recurrences exist within a calendar.

Can anyone suggest another approach?

TIA

Jeff Mowatt


EntryID is not allowable in a Restrict or Sort clause.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP]

The usual trick is to use CDO instead of Outlook to access the items, though it might be tough to access recurring appointments if they're not in your default Calendar folder (I've sure never tried it).

Why can't you restrict the collection?
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
J

Jeff Mowatt

Hello Sue,

The appointments are in my default calendar so I'll look into the CDO
approach.

I just want the dates and the restriction which would limit my collection to
only those I want to see would be EntryID and that's not allowed, though if
there was some other criteria that would at least strip out those
appointments with associated code it would help a lot.

Regards,

Jeff Mowatt

The usual trick is to use CDO instead of Outlook to access the items, though
it might be tough to access recurring appointments if they're not in your
default Calendar folder (I've sure never tried it).

Why can't you restrict the collection?
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP]

What about restricting on the subject? Or saving the item and then copying the EntryID to the BillingInformation property and saving again -- allowing you to restrict on the BillingInformation property?
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
J

Jeff Mowatt

Yes, that works quite well Sue. Thanks.

Actually it seems that the disable/enable macro messages I was getting
weren't anything to do with other appointments. When I published the form
they vanished, so they must have been caused by the form opening each
instance of the appointment. I didn't need to use billinginformation,
besides I'm using that for something else.

To ensure this works more efficiently I'll force the user to enter a subject
which will limit the number of instances in my collection, hopefully that
will speed things up a bit.

Trapping the PropertyChange event for Start also allows me to rebuild my
list keeping it in synch with the recurrence properties.

One further small question, where do recurrence exceptions get created? Can
I assume that my list takes these into account and I don't have to worry
about them?

Regards,

Jeff Mowatt


What about restricting on the subject? Or saving the item and then copying
the EntryID to the BillingInformation property and saving again -- allowing
you to restrict on the BillingInformation property?
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP]

If you need to see recurrences in the results of a Restrict, then you need to sort on the Start field and set IncludeRecurrences to True before you run the Restrict. This is well documented in Help.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 

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