Send message with attachment

  • Thread starter Thread starter Courtney
  • Start date Start date
C

Courtney

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
 
/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.
 
Back
Top