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

Global Variables/Session Variables



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 24th 07, 06:58 PM posted to microsoft.public.outlook.program_vba
dch3
external usenet poster
 
Posts: 105
Default Global Variables/Session Variables

I am developing code which runs on the Application_ItemSend event. I would
like to be able to capture information when the event is triggered and then
later recall the information the next time the event is called. I seem to
recall that in other versions of VBA, there is GLOBAL key word for use with
DIM that will do this, however it does not seem to be a part of Outlook VBA.
Am I missing something? Is there a way to do this?
Ads
  #2  
Old May 24th 07, 09:14 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Global Variables/Session Variables

Remember that ThisOutlookSession is a class module.You need to add at least one regular code module to the project and declare your global variables in it, not in ThisOutlookSession, by using the Public keyword instead of plain old Dim.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"dch3" wrote in message ...
I am developing code which runs on the Application_ItemSend event. I would
like to be able to capture information when the event is triggered and then
later recall the information the next time the event is called. I seem to
recall that in other versions of VBA, there is GLOBAL key word for use with
DIM that will do this, however it does not seem to be a part of Outlook VBA.
Am I missing something? Is there a way to do this?

  #3  
Old May 31st 07, 02:11 PM posted to microsoft.public.outlook.program_vba
dch3
external usenet poster
 
Posts: 105
Default Global Variables/Session Variables

Works like a charm.

"Sue Mosher [MVP-Outlook]" wrote:

Remember that ThisOutlookSession is a class module.You need to add at least one regular code module to the project and declare your global variables in it, not in ThisOutlookSession, by using the Public keyword instead of plain old Dim.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"dch3" wrote in message ...
I am developing code which runs on the Application_ItemSend event. I would
like to be able to capture information when the event is triggered and then
later recall the information the next time the event is called. I seem to
recall that in other versions of VBA, there is GLOBAL key word for use with
DIM that will do this, however it does not seem to be a part of Outlook VBA.
Am I missing something? Is there a way to do this?


 




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
Mail Form variables not passed Buyersusa Outlook Express 1 December 22nd 06 04:15 AM
variables? sensible Outlook Express 2 October 16th 06 03:34 AM
Accessing add-in's global variables [email protected] Add-ins for Outlook 4 September 24th 06 07:28 AM
List of predefined variables morten Outlook - Installation 1 June 2nd 06 02:30 AM
Sessions and Variables Ian Mackenzie Outlook and VBA 1 March 9th 06 03:35 PM


All times are GMT +1. The time now is 08:14 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.