basic question:is it common to cache outlook objects like namespace,default folders etc?

T

tomer

a basic question but I need your help,
Is it common to cache outlook objects like namespace,default folder(contacts
for example)
Or should I ask them from outlook whenever I need them?
I have a feeling that it is take some time to get the Namespace object for
example.

oh....I am talking about add in VB.

Thanks in advance.
 
D

Dmitry Streblechenko \(MVP\)

In general, it won't hurt, unless you cache too many Outlook objects.
If you are running Outlook without displaying its UI, make sure you *do*
cache an instance of Namespace and keep it referenced at all times. Also
make sure that you call Namespace.Logon. If Outlook has already acquired a
MAPI session, Namespace.Logon won't do anything, so no harm is done.
If your code is in an add-in, you don't have to do that.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 

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