Sessions and Variables

  • Thread starter Thread starter Ian Mackenzie
  • Start date Start date
I

Ian Mackenzie

Hi

Is it wise to connect to an RDOSession on startup and leave it running for
the duration of my application, or would it be better to connect and logon
each time I want to do something.

Also, when my program runs for the first time, I globally store all the
following. Is this the correct way to go about it?

procedure startup()
begin
//create RDOSession
RDOSession := CreateOleObject('Redemption.RDOSession');

//logon to RDO Session
RDOSession.Logon;

OutlookApp := CreateOLEObject('Outlook.Application');

NSpace := OutlookApp.GetNameSpace('MAPI');
NSpace.Logon;

RootFolder := RDOSession.Stores.DefaultStore.IPMRootFolder;
DeletedItems := RDOSession.GetDefaultFolder(3);
etc... for all folders...

All folders are fetched using the RDOSession and not the NameSpace...
Whats the difference?

Thanks for your help

Ian
 
I usually just create global RDOSession, MAPITable. etc. objects on startup
and use them for the duration of my program. You can do it on demand but
that adds some overhead for COM to create the objects and the MAPI
initializations to complete.

NameSpace is an Outlook object model object, RDOSession is a COM wrapper on
an Extended MAPI object. The items you get from one or the other are
different although you can move from one to the other using the EntryID and
StoreID of the objects and using NameSpace.GetItemFromID to get Outlook
items and RDOSession.GetMessageFromID.
 
Back
Top