opening WORD

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
Marc

opening WORD

Post by Marc »

Is it possible to open a window program such WORD with adequate commands inside a basic program?does it exist examples?
Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re »

Try SHELL

Example:

Code: Select all

SHELL "c:\path\to\word\word.exe"
I have left this dump.
PQBC...

Post 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"
MARC

GOTO WORD

Post by MARC »

All what I get is bad command or filename.
Have you tried it?
Antoni
Veteran
Posts: 132
Joined: Wed Jun 15, 2005 3:01 pm
Contact:

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

WORDS

Post 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...
User avatar
Zim
Veteran
Posts: 98
Joined: Mon Dec 05, 2005 4:31 pm
Location: Wisconsin, USA
Contact:

Returning to Basic

Post 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).
--- Zim ---
--- Time flies like an arrow, but fruit flies like a banana ---
Post Reply