PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Start Application (Shell) / Custom Button
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Start Application (Shell) / Custom Button
![]() |
Start Application (Shell) / Custom Button |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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 =============================================== >-----Original Message----- >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 > > >. > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
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 http://www.outlookcode.com/jumpstart.aspx "Andrew Cushen" <anonymous@discussions.microsoft.com> wrote in message news:1280801c3f645$7b403e50$a401280a@phx.gbl... > 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 > =============================================== > >-----Original Message----- > >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 > > > > > >. > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

