![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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 |
Ads |
#2
|
|||
|
|||
![]()
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. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Ian Mackenzie" wrote in message ... 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Get values of custom variables from customised contact form | Michael Anderson | Outlook and VBA | 1 | February 6th 06 10:06 PM |