PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming Start Application (Shell) / Custom Button

Reply

Start Application (Shell) / Custom Button

 
Thread Tools Rate Thread
Old 18-02-2004, 02:40 PM   #1
Jos Vens
Guest
 
Posts: n/a
Default Start Application (Shell) / Custom Button


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


  Reply With Quote
Old 18-02-2004, 05:34 PM   #2
Andrew Cushen
Guest
 
Posts: n/a
Default Start Application (Shell) / Custom Button

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

  Reply With Quote
Old 18-02-2004, 07:06 PM   #3
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: Start Application (Shell) / Custom Button

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



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off