View Single Post
  #2  
Old December 19th 08, 10:28 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Send message with attachment

/altvba forces Outlook to open with a specific VBA project file instead of
the default one.

If you have a VBA project that calls your macro in the Application_Startup()
event you will have most of what you want. The call to your macro must be in
that event handler in the ThisOutlookSession class and Outlook must be
configured to allow running VBA without prompting.

Then if you have a vbs file that starts Outlook with that special project
you can run it from a task scheduler. Of course since the script couldn't
know when Outlook had initialized and sent the message you'd need code to
start a SyncObject to send the message and a handler to know when the synch
was finished, and then to close Outlook.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Courtney" courtney[dot]piratzky[at]gasoc[dot]com wrote in message
...
I need to be able to automate creating a message, attaching a file, and
sending the message without manual intervention. I can create the message
with an attachment in several different ways, but I haven't been able to
find a way to automate the sending of it. I have been able to create a
macro in Outlook and manually run it successfully, but I can't run it using
the outlook /autorun switch. I found the outlook switch /altvba
VbaProject.OTM, but I can't figure out how to use it.
Does anyone have any suggestions on how I can accomplish this task?

Thank you very much for your assistance!

Courtney


Ads