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

Automatically trigger a VBA macro to run when connection to exchange server has been made.



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 25th 06, 08:52 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 2
Default Automatically trigger a VBA macro to run when connection to exchange server has been made.

I am currently producing a very simple electronic in/out board for my
company. It works by using a public folder to which are posted the
names of everyone in a particular office. For each user you can select
whether you are in or out, where you are and when you are likely to
return.

I have written a number of VBA macros which can be run by the users to
update their status, the system also automatically marks them as out
when Outlook is closed.

I would like to call the "sign in" macro to run automatically when
outlook starts up, but as there is a delay between outlook starting and
finally connecting to our exchange server (very tempermental
connection) I need to call the sign in macro when the connection has
been established.

Does anyone know how I could call this macro to run at the right time?

Ads
  #2  
Old January 30th 06, 10:29 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Automatically trigger a VBA macro to run when connection to exchan

I've struggled with the best way to approach doing a startup task with
Exchange before and had to ping fellow MVP Ken Slovak to jog my memory; see
what he says below. If you don't want to run your code on
Application_Startup, consider hooking into the SyncStart event for any of the
SyncObjects that are available for each Send/Receive group, even if none of
them are Exchange-specific. These calls should at least give you some
seconds after startup to hope that an Exchange connection could be made in
the interim.

I would check a combination of NameSpace.ExchangeConnectionMode,
NameSpace.Offline (PR_STORE_OFFLINE for earlier than Outlook 2002)
and PR_REPLICA_VERSION (Exchange version, 0.0.0.0 for offline or
cached mode). That covers combinations of Outlook and Exchange
versions pretty well.

The old CDO way of putting PR_REPLICA_VERSION (PT_I8) into a string
for CDO 1.21 from the KB doesn't work when using Redemption. See
http://www.slovaktech.com/code_sampl...xchangeVersion for a
Redemption version of the KB code.

Also, when retrieving PR_REPLICA_VERSION for Exchange 2000 and 2003
you get "6.5.xxxx.xxxx" for both. So you have to look at the minor
and build fields to see which version of Exchange.

http://support.microsoft.com/default...b;en-us;158530 lists
the versions, so you can use that to figure out EX2003 or EX2000.

--
Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


" wrote:

I am currently producing a very simple electronic in/out board for my
company. It works by using a public folder to which are posted the
names of everyone in a particular office. For each user you can select
whether you are in or out, where you are and when you are likely to
return.

I have written a number of VBA macros which can be run by the users to
update their status, the system also automatically marks them as out
when Outlook is closed.

I would like to call the "sign in" macro to run automatically when
outlook starts up, but as there is a delay between outlook starting and
finally connecting to our exchange server (very tempermental
connection) I need to call the sign in macro when the connection has
been established.

Does anyone know how I could call this macro to run at the right time?


 




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
How can 2 calendars always be made to open automatically? Its a cracker... Outlook - Calandaring 1 February 23rd 06 01:27 PM
connection setting changes automatically Chris Outlook - Installation 1 February 3rd 06 11:28 PM
Automatically trigger a VBA macro to run when connection to exchange server has been made. [email protected] Outlook and VBA 0 January 25th 06 08:52 PM
Outlook 2000 - Button to run Macro then open Database David C Outlook and VBA 1 January 25th 06 03:44 PM
Rule doesn't run automatically [email protected] Outlook - General Queries 5 January 24th 06 03:21 PM


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