I want to open an external application such as MS Word when a user clicks on a control button. Does anyone have some code that would help please???
Printable View
I want to open an external application such as MS Word when a user clicks on a control button. Does anyone have some code that would help please???
Look in the help for the Shell command - you use this to run external applications.
eg;
X=Shell("winword.exe",1)
should run Microsoft Word.
------------------
Mark "Buzby" Beeton
VB Developer
[email protected]
You can also use the ShellExecute API if you want to open a specific file.
Wade
Private Sub Command1_Click()
Dim shellProgram As String
Dim res
shellProgram = "C:\WINWORD.EXE"
res = Shell(shellProgram, vbNormalFocus) End Sub
unless Winword.exe is installed to the root directory (C:\) that won't work.
You'll need to specify the exact path of WINWORD.EXE (or using just Winword.exe should work since Windows can probably find it)...
------------------
Rapmaster