Start Application (Shell) / Custom Button

  • Thread starter Thread starter Jos Vens
  • Start date Start date
J

Jos Vens

Hi,

Is it possible to start an application from Outlook?

I have the command

Private Sub Application_NewMail()
DoTest
End Sub

'Global module
Sub DoTest()
vStatus = Shell ("C:\Temp\Test.xls")
End Sub

but I get an error message (the excel workbook does exist in the temp
directory).

It would also be very nice to have a custom button the can be pressed to
start an application from within Outlook. Is that possible?

Thanks
Jos Vens
 
Jos-

The Shell function doesn't use file associations, it only
loads a program. You can use it to load Excel, but not
with a specific file loaded.

What you *can* do, is use the Shell function to load
Excel, then use VBA automation code (from Outlook) to load
a specific file. See the VBA Help for Excel- hit Alt+F11
in Excel, then F1 for Help - for examples.

-Andrew
===============================================
 
Or, skip the Shell, instantiate an Excel Application object with GetObject
or CreateObject, then use Excel's methods.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top