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

  • Thread starter Thread starter tomer
  • Start date Start date
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.
 
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
 
Back
Top