Launching MS App from within VB app 
Author Message
 Launching MS App from within VB app

Hello all,

This will (hopefully) be a VERY simple question.

I have created a very simple application in VB 3 that has menu
selections that will open a document in it's associated application.
The simple code for one of these menu objects is as follows:

Sub CommToolsEnrolTrial_Click ()
    Dim I, X, Msg
    ' AppActivate "Microsoft Visual Basic"
    ' SendKeys "%{ }{Down 3}{Enter}", True
    X = Shell("C:\...\WINWORD.EXE C:\...\STRIAL.DOC", 1)
End Sub

As you can see, if the user returns to my app after making a selection,
and makes another selection, the application will launch again.  Having
20 copies of Word open in WFW....BOOM!

How can I get my objects to check to see if the application is alerady
running, and either open the document in the already launched
application, or laiunch the application and open the document if not?

I will be using Word 6, Excel 5 and PowerPoint 4 and the app will be
running in either WFW or WIN 95.

Thanks a million in advance.

Jeremy Russell
William M. Mercer Limietd



Mon, 28 Feb 2000 03:00:00 GMT  
 Launching MS App from within VB app

Hi, Jeremy,

I think if you use the API function ShellExecute, instead of Shell, this
will prevent multiple instances of the MS apps from running.

Hope this helps,
Annette Gates



Quote:
> Hello all,

> This will (hopefully) be a VERY simple question.

> I have created a very simple application in VB 3 that has menu
> selections that will open a document in it's associated application.
> The simple code for one of these menu objects is as follows:

> Sub CommToolsEnrolTrial_Click ()
>     Dim I, X, Msg
>     ' AppActivate "Microsoft Visual Basic"
>     ' SendKeys "%{ }{Down 3}{Enter}", True
>     X = Shell("C:\...\WINWORD.EXE C:\...\STRIAL.DOC", 1)
> End Sub

> As you can see, if the user returns to my app after making a selection,
> and makes another selection, the application will launch again.  Having
> 20 copies of Word open in WFW....BOOM!

> How can I get my objects to check to see if the application is alerady
> running, and either open the document in the already launched
> application, or laiunch the application and open the document if not?

> I will be using Word 6, Excel 5 and PowerPoint 4 and the app will be
> running in either WFW or WIN 95.

> Thanks a million in advance.

> Jeremy Russell
> William M. Mercer Limietd



Fri, 03 Mar 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. QUEST: Launch a Web Page from Within VB App

2. Launching an app from within a VB program

3. to call an app from within a VB app

4. Testing for MS Office apps within a VB program

5. Launching vb app when IE launch

6. Launching 16-Bit apps from 32-Bit app?

7. Web app launching a legacy app

8. How to launch and kill an app from my app

9. Launching eVB app from eVB app...

10. Getting the App's Icon from within a VB4 App

11. Starting another app within app??

12. app within an app

 

 
Powered by phpBB® Forum Software