Accessing Outlook contacts...

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?
 
S

Sue Mosher [MVP-Outlook]

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.
 

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