Page 1 of 1

opening WORD

Posted: Tue Dec 20, 2005 7:32 am
by Marc
Is it possible to open a window program such WORD with adequate commands inside a basic program?does it exist examples?

Posted: Tue Dec 20, 2005 10:49 am
by Z!re
Try SHELL

Example:

Code: Select all

SHELL "c:\path\to\word\word.exe"

Posted: Thu Dec 22, 2005 12:07 am
by PQBC...
Z!re wrote:Try SHELL

Example:

Code: Select all

SHELL "c:\path\to\word\word.exe"
If that gives you problems by saying "This program cannot be run under DOS." (or something like that) try inserting START before the path.

Example:

Code: Select all

SHELL "START C:\YOURPATH\ANOTHERPATH\word.exe"
If running Windows XP, you can insert LOW, BELOWNORMAL, ABOVENORMAL, HIGH, and REALTIME to change priority (how much 'attention' it gets).
You can also add the WAIT command to wait until your program (in this case, word) stops before continuing with your program.
Example:

Code: Select all

SHELL "START C:\YOURPATH\ANOTHERPATH\word.exe REALTIME WAIT"

GOTO WORD

Posted: Tue Jan 03, 2006 5:37 am
by MARC
All what I get is bad command or filename.
Have you tried it?

Posted: Tue Jan 03, 2006 6:26 am
by Antoni
First, the name of Word's exec is Winword. exe
Then you have to specify the path using 8.3 names
This works for me:

Code: Select all

shell "c:\progra~1\micros~2\office\winword.exe"
Notice the micros~2 could be perhaps micros~1 or even micros~7 for you, depending on how many microsoft apps you have and the order you installed them.

WORDS

Posted: Tue Jan 03, 2006 7:21 am
by MARC
Fine it works.Now to come back to the QB program? Words would just be used to look at some items for a later programming selection...

Returning to Basic

Posted: Wed Jan 04, 2006 12:18 pm
by Zim
You need an exit from the shell. If it's not returning to QB automatically, you may need to run a batch file instead of WORD directly, then put the command "exit" at the end of the batch file. (...but I didn't actually try this).