Share via

Vba code for starting an external application and running a file

Anonymous
2016-05-17T21:59:02+00:00

i have a command button in a word document operating under active x, using the shell command in the code, I have managed to execute the operation of the program.   What I can't seem to do is get it to run the program in a maximised window and load the file to run.

Just a thought

would it be better to have the code to execute the file which will open the application and play the file?   If so how would I go about this?

thanks in advance for any help

regards

colin

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Andreas Killer 144.1K Reputation points Volunteer Moderator
2016-05-18T07:12:24+00:00

What I can't seem to do is get it to run the program in a maximised window and load the file to run.

would it be better to have the code to execute the file which will open the application and play the file?

a) Have a look at the help and the 2nd argument of SHELL

b) It depends on your external application if and which command line arguments are supported.

Andreas.

Was this answer helpful?

0 comments No comments

5 additional answers

Sort by: Most helpful
  1. Anonymous
    2016-05-24T20:41:24+00:00

    Not having much luck here , is there any way to make the pc do the CTRL +O keystrokes to open a file of the active application?

    Was this answer helpful?

    0 comments No comments
  2. Steve Rindsberg 99,161 Reputation points MVP Volunteer Moderator
    2016-05-22T16:56:53+00:00

    Have a look here:

    http://ftp.asia.edu.tw/Internet/purevoice/pvconvreadme.txt

    This may apply to an older version of PureVoice ... I really have no idea, but it suggests that there's a command line version that you can pass parameters to.

    Was this answer helpful?

    0 comments No comments
  3. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2016-05-22T10:58:49+00:00

    While the following line of code worked to open the application, how would i then make it open ans play a specific file?

    As I said it depends on the application if that is possible, you have to ask the developer for the possible command line arguments.

    For Windows Notepad you can execute this to open (or create) a file:

      Shell "notepad c:\test.txt"

    Andreas.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2016-05-21T21:17:55+00:00

    Thanks Anreas

    While the following line of code worked to open the application, how would i then make it open ans play a specific file?

    Shell ("C:\Program Files (x86)\Qualcomm\PureVoice\PureVoice.exe"), VbAppWinStyle.vbMaximizedFocus

    Any help appreciated

    Colin

    Was this answer helpful?

    0 comments No comments