Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Command Line switch: autorun

136 views
Skip to first unread message

Hapyfishrmn

unread,
Jul 14, 2004, 12:43:14 PM7/14/04
to
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

Ken Slovak - [MVP - Outlook]

unread,
Jul 14, 2004, 4:42:22 PM7/14/04
to
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.

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


"Hapyfishrmn" <hapyf...@yahoo.com> wrote in message
news:c98e2c8c.04071...@posting.google.com...

Hapyfishrmn

unread,
Jul 15, 2004, 8:38:01 AM7/15/04
to
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]" <kens...@mvps.org> wrote in message news:<uvXZiNea...@TK2MSFTNGP10.phx.gbl>...

Ken Slovak - [MVP - Outlook]

unread,
Jul 15, 2004, 1:46:39 PM7/15/04
to
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.

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


"Hapyfishrmn" <hapyf...@yahoo.com> wrote in message
news:c98e2c8c.04071...@posting.google.com...

Eric Legault [MVP - Outlook]

unread,
Jul 16, 2004, 3:27:02 PM7/16/04
to
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/

Grég

unread,
Jul 19, 2004, 1:51:26 PM7/19/04
to
Hi,

"Eric Legault [MVP - Outlook]" <elega...@REMOVEZZZmvps.org> a écrit dans
le message de news:8D0AE2BC-3453-4935...@microsoft.com...


> 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

Eric Legault [MVP - Outlook]

unread,
Jul 19, 2004, 2:07:05 PM7/19/04
to
The SMTP client you mentioned does not support macros, so this app is of no use to the user.

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

unread,
Jul 19, 2004, 3:16:19 PM7/19/04
to
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
news:c98e2c8c.04071...@posting.google.com)


"Eric Legault [MVP - Outlook]" <elega...@REMOVEZZZmvps.org> a écrit dans

le message de news:94E4334D-DCB0-423F...@microsoft.com...


> 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 [MVP - Outlook]

unread,
Jul 19, 2004, 3:55:03 PM7/19/04
to
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.

Hapyfishrmn

unread,
Jul 20, 2004, 8:53:14 AM7/20/04
to
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

Eric Legault [MVP - Outlook]

unread,
Jul 20, 2004, 10:15:04 AM7/20/04
to
Here's a great article at MSDN that'll tell you all you need to know:

Selecting a Client Interface:
http://msdn.microsoft.com/library/en-us/mapi/html/_mapi1book_selecting_a_client_interface.asp?frame=true

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

0 new messages