A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Sessions and Variables



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 9th 06, 08:09 AM posted to microsoft.public.outlook.program_vba
Ian Mackenzie
external usenet poster
 
Posts: 10
Default Sessions and Variables

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  
Old March 9th 06, 03:35 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Sessions and Variables

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 08:18 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.