Command Line switch: autorun

  • Thread starter Thread starter Hapyfishrmn
  • Start date Start date
H

Hapyfishrmn

Hey,
I am trying to run the command line switch autorun, to run a macro.
the Macro will work if I open up Outlook 2003 and go to tools->macro.
But I am unable to run it from the command line.
so my command line says:

"C:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE" /autorun
ScheduledTask

In the global scenario I want to be able to email myself if a started
task fails.
Which you can set up through the services (Task Scheduler).
Any advice on this?

thanks in advance

G
 
There is no autorun switch, and no autorun macros like in Word.

To run a macro on Outlook startup you would have to call it from the
Application_Startup event handler in the ThisOutlookSession class module.
 
Hello again,
I not sure about how to do that or maybe I need to try a different
route.
Is it possible to email yourself if a started task fails. In the Task
Scheduler under the Computer Management->Services you can set a
program to run if it fails. I have been unable to get that to work at
all. Since this task is on another machine I would want it to email
me. So I thought that running a macro that emails me would do it. But
now I am not so sure where to go.

G
 
I don't know much of anything about the task scheduler.

To see how to set up code in ThisOutlookSession you can look at
http://www.outlookcode.com/d/code/zaphtml.htm, which runs automatically but
shows how to initialize code in Application_Startup. The code would just be
a Sub in any code module or in the ThisOutlookSession class module that is
called from the Application_Startup event.

You would have to write your own code from scratch, however. Outlook also
doesn't have a macro recorder as Word does.
 
What you need to do is create an .exe or a .bat file. The former can be created using VB6 or any programming language/IDE that supports COM automation; this way you can automate the Outlook Object Model. The latter requires a scripting language (VBScripg, Java) using the Windows Scripting Host; either language supports COM hooks into Outlook.

So you basically need to write a custom application/script that sends the e-mail, and have this run whenever a given task in the Task Scheduler fails. You would not write the code within the Outlook VBA Editor itself.

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/
 
Hi,

Eric Legault said:
What you need to do is create an .exe or a .bat file.
...

Easier should be to use one of the numerous command line smtp clients (ie
Blat : http://www.blat.net !-)

--
Grég

So you basically need to write a custom application/script that sends the
e-mail, and have this run whenever a given task in the Task Scheduler fails.
You would not write the code within the Outlook VBA Editor itself.
--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/



Hapyfishrmn said:
Hello again,
I not sure about how to do that or maybe I need to try a different
route.
Is it possible to email yourself if a started task fails. In the Task
Scheduler under the Computer Management->Services you can set a
program to run if it fails. I have been unable to get that to work at
all. Since this task is on another machine I would want it to email
me. So I thought that running a macro that emails me would do it. But
now I am not so sure where to go.

G




"Ken Slovak - [MVP - Outlook]" <[email protected]> wrote in message
There is no autorun switch, and no autorun macros like in Word.

To run a macro on Outlook startup you would have to call it from the
Application_Startup event handler in the ThisOutlookSession class module.




Hey,
I am trying to run the command line switch autorun, to run a macro.
the Macro will work if I open up Outlook 2003 and go to tools->macro.
But I am unable to run it from the command line.
so my command line says:

"C:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE" /autorun
ScheduledTask

In the global scenario I want to be able to email myself if a started
task fails.
Which you can set up through the services (Task Scheduler).
Any advice on this?

thanks in advance

G
 
Eric,

To run a macro in Outlook was a way the user thought to answer its main
goal:

"In the global scenario I want to be able to email myself if a started
task fails.
Which you can set up through the services (Task Scheduler).
Any advice on this?" (from


Eric Legault said:
The SMTP client you mentioned does not support macros, so this app is of
no use to the user.

So to be able to send an email using a command line may help the user even
if this program do not support macros !-))

--
Grég

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/


Grég said:
Hi,

"Eric Legault [MVP - Outlook]" <[email protected]> a écrit dans
le message de news:[email protected]...
What you need to do is create an .exe or a .bat file.
...

Easier should be to use one of the numerous command line smtp clients (ie
Blat : http://www.blat.net !-)

--
Grég

So you basically need to write a custom application/script that sends
the
e-mail, and have this run whenever a given task in the Task Scheduler fails.
You would not write the code within the Outlook VBA Editor itself.
--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/



:

Hello again,
I not sure about how to do that or maybe I need to try a different
route.
Is it possible to email yourself if a started task fails. In the Task
Scheduler under the Computer Management->Services you can set a
program to run if it fails. I have been unable to get that to work at
all. Since this task is on another machine I would want it to email
me. So I thought that running a macro that emails me would do it. But
now I am not so sure where to go.

G




"Ken Slovak - [MVP - Outlook]" <[email protected]> wrote in message
There is no autorun switch, and no autorun macros like in Word.

To run a macro on Outlook startup you would have to call it from the
Application_Startup event handler in the ThisOutlookSession class module.




Hey,
I am trying to run the command line switch autorun, to run a macro.
the Macro will work if I open up Outlook 2003 and go to tools->macro.
But I am unable to run it from the command line.
so my command line says:

"C:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE" /autorun
ScheduledTask

In the global scenario I want to be able to email myself if a started
task fails.
Which you can set up through the services (Task Scheduler).
Any advice on this?

thanks in advance

G
 
Right you are; I forgot about that over the weekend.

Another option is to code against Simple MAPI; this would then use any MAPI compliant e-mail application that is installed for simple sends.

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/



Grég said:
Eric,

To run a macro in Outlook was a way the user thought to answer its main
goal:

"In the global scenario I want to be able to email myself if a started
task fails.
Which you can set up through the services (Task Scheduler).
Any advice on this?" (from


Eric Legault said:
The SMTP client you mentioned does not support macros, so this app is of
no use to the user.

So to be able to send an email using a command line may help the user even
if this program do not support macros !-))

--
Grég

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/


Grég said:
Hi,

"Eric Legault [MVP - Outlook]" <[email protected]> a écrit dans
le message de What you need to do is create an .exe or a .bat file.
...

Easier should be to use one of the numerous command line smtp clients (ie
Blat : http://www.blat.net !-)

--
Grég



So you basically need to write a custom application/script that sends the
e-mail, and have this run whenever a given task in the Task Scheduler fails.
You would not write the code within the Outlook VBA Editor itself.

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/



:

Hello again,
I not sure about how to do that or maybe I need to try a different
route.
Is it possible to email yourself if a started task fails. In the Task
Scheduler under the Computer Management->Services you can set a
program to run if it fails. I have been unable to get that to work at
all. Since this task is on another machine I would want it to email
me. So I thought that running a macro that emails me would do it. But
now I am not so sure where to go.

G




There is no autorun switch, and no autorun macros like in Word.

To run a macro on Outlook startup you would have to call it from the
Application_Startup event handler in the ThisOutlookSession class
module.




Hey,
I am trying to run the command line switch autorun, to run a macro.
the Macro will work if I open up Outlook 2003 and go to
tools->macro.
But I am unable to run it from the command line.
so my command line says:

"C:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE" /autorun
ScheduledTask

In the global scenario I want to be able to email myself if a
started
task fails.
Which you can set up through the services (Task Scheduler).
Any advice on this?

thanks in advance

G
 
Hello again,
Another option is to code against Simple MAPI; this would then use
any MAPI compliant e-mail application that is installed for simple
sends.


Where is some good information about coding using MAPI. Better yet I
would like to know more about what it is. So I would know how to get
started to program it.

I appreciate all the comments.

G
 
Back
Top