Guest Jabba The Hunt Posted September 8, 2001 Posted September 8, 2001 Ok ive recently got VB (Visual Basic) and Im trying to run programs from a form, (just for the hell of it really) anyway a guy I know told me to use the Shell command to do this, so i had a look through the Msdn library and found the code, ive been working on getting it write now for about an hour and it just wont work - if you are interested im trying to get word to run as the test piece, heres the code Private Sub Word_Click() Shell("C:\Program Files\Microsoft Office\Office\WINWORD.EXE", [Windowstyle As VbAppwinstyle = vbMinimizedFocus]) As Double End Sub Word is the name of the button to activate word suprisingly. If any of you amazingly intelligent monkeys can help then I would be very grateful. ------------------ "Getting Drunk is great you should try it sometime" "I did once, I just cant remember if I enjoyed it or not" jabbathehunt@hotmail.com
Keyan Farlander Posted September 9, 2001 Posted September 9, 2001 I suggest: Visual Basic sucks - don't use it.
Guest Jabba The Hunt Posted September 9, 2001 Posted September 9, 2001 Me doing A level computer course, me have to learn it, me need help, please? ------------------ "Getting Drunk is great you should try it sometime" "I did once, I just cant remember if I enjoyed it or not" jabbathehunt@hotmail.com
Darth Jimbo Posted September 9, 2001 Posted September 9, 2001 jbaa im doin a-level computin, and we dont use VB, coz as many ppl have sed : VB sucks so dont use it!! use QBASIC instead :-D
Guest Zoom Rabbit Posted September 10, 2001 Posted September 10, 2001 Have you tried sticking the garden hose in your DLL port? Cleared up my computer's attitude problems, lemme tell ya...
Guest Hans The Great Posted September 11, 2001 Posted September 11, 2001 I am a VB Programmer and the language does not suck, in fact it gets better all the time. As for your question Jabba: Some of those MSDN examples are not 100% correct, be wary about using them. The Shell() command is actually a function that returns a value (integer). This number is the process handle, the shelled program's "ID number". Try using this code: Dim X as Integer X = Shell({Application Path}) (Note:If you get an "Error 53" message, then that means that the file path is incorrect) Also,do you want to open Word minimized? That is what your code will do. A better option might be to instantiate the Word object itself from within your code and work with it that way (This is what I usually do, I have'nt used Shell in a while). Check out the MSDN Online site for more info on that. [This message has been edited by Hans The Great (edited September 10, 2001).]
Recommended Posts
Archived
This topic is now archived and is closed to further replies.