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

terminate the routine if outlook is not available



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 26th 06, 09:54 PM posted to microsoft.public.outlook.program_vba
fitful_thought
external usenet poster
 
Posts: 4
Default terminate the routine if outlook is not available

This code forms part of a routine that will be running on some computers
that have Outlook 2003 and some that have Outlook Web Access for Exchange
2003.

DimOutAppAsOutlook.Application
DimOutMailAsOutlook.MailItem
SetOutApp=CreateObject("Outlook.Application")
SetOutMail=OutApp.CreateItem(olMailItem)

Can I add something to the above code to terminate the routine if outlook is
not available?

Please feel free to contribute is you have an ideas.


Ads
  #2  
Old April 27th 06, 05:26 AM posted to microsoft.public.outlook.program_vba
Michael Bauer
external usenet poster
 
Posts: 435
Default terminate the routine if outlook is not available

Am Thu, 27 Apr 2006 06:54:22 +1000 schrieb fitful_thought:

A simle error handler does the trick:

On Error Resume Next
Dim OutApp AsOutlook.Application
Dim OutMail AsOutlook.MailItem
Set OutApp=CreateObject("Outlook.Application")
If Not OutApp Is Nothing Then
Set OutMail=OutApp.CreateItem(olMailItem)
Else
' Not available
MsgBox Err.Description
Endif

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


This code forms part of a routine that will be running on some computers
that have Outlook 2003 and some that have Outlook Web Access for Exchange
2003.

DimOutAppAsOutlook.Application
DimOutMailAsOutlook.MailItem
SetOutApp=CreateObject("Outlook.Application")
SetOutMail=OutApp.CreateItem(olMailItem)

Can I add something to the above code to terminate the routine if outlook

is
not available?

Please feel free to contribute is you have an ideas.

  #3  
Old April 27th 06, 09:27 PM posted to microsoft.public.outlook.program_vba
fitful_thought
external usenet poster
 
Posts: 4
Default terminate the routine if outlook is not available

Thank you Michael.
DL


"Michael Bauer" wrote in message
...
Am Thu, 27 Apr 2006 06:54:22 +1000 schrieb fitful_thought:

A simle error handler does the trick:

On Error Resume Next
Dim OutApp AsOutlook.Application
Dim OutMail AsOutlook.MailItem
Set OutApp=CreateObject("Outlook.Application")
If Not OutApp Is Nothing Then
Set OutMail=OutApp.CreateItem(olMailItem)
Else
' Not available
MsgBox Err.Description
Endif

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


This code forms part of a routine that will be running on some computers
that have Outlook 2003 and some that have Outlook Web Access for Exchange
2003.

DimOutAppAsOutlook.Application
DimOutMailAsOutlook.MailItem
SetOutApp=CreateObject("Outlook.Application")
SetOutMail=OutApp.CreateItem(olMailItem)

Can I add something to the above code to terminate the routine if outlook

is
not available?

Please feel free to contribute is you have an ideas.



 




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
terminate the routine if outlook is not available fitful_thought Outlook - General Queries 1 April 26th 06 02:01 PM
Outlook calendar should allow colouring days to follow a routine MartinD Outlook - Calandaring 1 April 14th 06 06:24 AM


All times are GMT +1. The time now is 09:00 AM.


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