Accessing Outlook contacts...

  • Thread starter Thread starter J S
  • Start date Start date
J

J S

I have a script that loops through all the outlook contacts in a public
folder. All the contacts are supposed have a messageclass equal to a
particular custom contact form. Under some circumstances the contacts get
one-offed. Whenever you try to open a one-offed contact interactively it
always gives you the warning "Do you want to Enable/Disable macros?".

In my code I check to make sure that I am only reading contacts that use the
correct form.

If Ucase(thing.messageclass) = ucase("IPM.Contact.OTScontact") then
.....

But it when I try to check the messageclass of the contact outlook seems to
attempt to open the contact in question because I get the "Enable/Disable
Macros" Warning which stops my script until someone presses one of the
buttons.

Is there anyway to check what the message class of a contact is without
triggering the macros warning?

Is there anyway to programmatically disable macros when acessing a contact?
 
You can use CDO instead of Outlook objects to loop through the folder. If
you upgrade to a recent version of Outlook (anything OL2000 SP2 or later),
you'll never see a form enable/disable macro prompt.
 
Back
Top