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

Closing Outlook Programmatically



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 2nd 07, 07:12 PM posted to microsoft.public.outlook.program_vba
Michael Ryle
external usenet poster
 
Posts: 6
Default Closing Outlook Programmatically

I posted the following in the General Questions section, and then on second
thought, realized that I probably should have posted it here. Forgive the
duplication.

I'm running Outlook 2003 on Windows 2000.

I have a scheduled task that runs a script that backs up files to an
external drive every night.

This works fine, except when I forget to close Outlook.

If the Outlook .pst file is open, the backup script is not allowed to copy
it, zip it, do anything with it. (BTW, Outlook is the only application I'm
using that imposes this stricture.)

My question is this: is is possible to write an Outlook macro that will
instruct Outlook to close itself at a certain time of day, prior to the
scheduled backup, so that my script will be allowed to back it up?

Or -- just in case there should happen to be someone out there who knows
something about Objject REXX, the language my backup script is written in --
is it possible to close Outlook from the script before the backup runs?

Any help is appreciated.

Ads
  #2  
Old January 2nd 07, 07:41 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Closing Outlook Programmatically

The Quit method of the Outlook.Application object can be used but not from
within an Outlook macro.

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


"Michael Ryle" wrote in message
...
I posted the following in the General Questions section, and then on second
thought, realized that I probably should have posted it here. Forgive the
duplication.

I'm running Outlook 2003 on Windows 2000.

I have a scheduled task that runs a script that backs up files to an
external drive every night.

This works fine, except when I forget to close Outlook.

If the Outlook .pst file is open, the backup script is not allowed to copy
it, zip it, do anything with it. (BTW, Outlook is the only application
I'm
using that imposes this stricture.)

My question is this: is is possible to write an Outlook macro that will
instruct Outlook to close itself at a certain time of day, prior to the
scheduled backup, so that my script will be allowed to back it up?

Or -- just in case there should happen to be someone out there who knows
something about Objject REXX, the language my backup script is written
in --
is it possible to close Outlook from the script before the backup runs?

Any help is appreciated.


  #3  
Old January 3rd 07, 12:33 AM posted to microsoft.public.outlook.program_vba
Michael Ryle
external usenet poster
 
Posts: 6
Default Closing Outlook Programmatically

I'm confused. If this method can't be used within a macro, i.e. VBA code,
then where is it used?

What I'm looking for is simple, a piece of VBA code that is able to:

1. recognize it's a certain time of day, say 10 PM
2. based on the outcome of #1, tell Outlook to shut down so that another
process can back up the .pst file

Surely I'm not the only person who has run into this problem.

"Ken Slovak - [MVP - Outlook]" wrote:

The Quit method of the Outlook.Application object can be used but not from
within an Outlook macro.

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


"Michael Ryle" wrote in message
...
I posted the following in the General Questions section, and then on second
thought, realized that I probably should have posted it here. Forgive the
duplication.

I'm running Outlook 2003 on Windows 2000.

I have a scheduled task that runs a script that backs up files to an
external drive every night.

This works fine, except when I forget to close Outlook.

If the Outlook .pst file is open, the backup script is not allowed to copy
it, zip it, do anything with it. (BTW, Outlook is the only application
I'm
using that imposes this stricture.)

My question is this: is is possible to write an Outlook macro that will
instruct Outlook to close itself at a certain time of day, prior to the
scheduled backup, so that my script will be allowed to back it up?

Or -- just in case there should happen to be someone out there who knows
something about Objject REXX, the language my backup script is written
in --
is it possible to close Outlook from the script before the backup runs?

Any help is appreciated.



  #4  
Old January 3rd 07, 02:21 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Closing Outlook Programmatically

I didn't say it can't be used, I recommended against using it within an
Outlook macro. Make up a VBS script file and call that when you want to
close Outlook. Something like this:

Set oOL = Nothing
Set oOL = GetObject(, "Outlook.Application")
If Not (oOL Is Nothing) Then
oOL.Quit
Set oOL = Nothing
End If

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


"Michael Ryle" wrote in message
...
I'm confused. If this method can't be used within a macro, i.e. VBA code,
then where is it used?

What I'm looking for is simple, a piece of VBA code that is able to:

1. recognize it's a certain time of day, say 10 PM
2. based on the outcome of #1, tell Outlook to shut down so that another
process can back up the .pst file

Surely I'm not the only person who has run into this problem.


 




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 I delete MAPI/Outlook profiles Programmatically. news.microsoft.com Outlook - General Queries 3 November 14th 06 05:52 PM
Outlook Not Closing Down Alan W Outlook - Installation 1 July 11th 06 09:32 PM
Programmatically change Outlook Settings Mitchell Outlook and VBA 0 June 29th 06 04:31 PM
Closing Outlook correctly PhilipPainter Outlook and VBA 3 April 25th 06 02:50 PM
Programmatically changing settings in Outlook 2003 Jonathan Add-ins for Outlook 1 April 7th 06 07:49 PM


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