Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shell command

Status
Not open for further replies.

dakone

Programmer
Jun 23, 2003
28
CA
Code:
Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long

Private Sub Command1_Click()

    Call ShellExecute(0, "Open", "D:\Resume.doc", vbNullString, vbNullString, vbNormalFocus)
   
End Sub
This opens my resume from a disk in MS Word. How can I make the doc open in Word Perfect if that is what the user is using instead?
 


Call ShellExecute(0, "Open", strPathWordPerfect, strDocToOpen, vbNullString, vbNormalFocus)
'Where strPathWordPerfect is the path and wordperfect.exe file and strDocToOpen is D:\Resume.doc
 
This will open any doc with it's default application

Public Sub OpenDocument(DocumentWithPath As String)
Shell "RUNDLL32.EXE URL.DLL, FileProtocolHandler " & DocumentWithPath, vbNormalFocus
End Sub

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Click open after doing the following.! ;o)
Private Sub Command1_Click()
Shell ("explorer.exe f:\one.doc")
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top