Since much has been said about the ShellExecute API you might as well have that too. To test this you will have to rename the ShellTest.docs with your file names and you will have to insure that path$ matches yours. Just repeat the ShellExecute lines for the other two docs that you have.
Code:Option Explicit 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 Dim path$ Const SW_MAXIMIZE = 3 Private Sub cmdOpenDocs_Click() path$ = "C:\Documents And Settings\Owner\My Documents" ShellExecute Me.hwnd, "open", path$ & "\ShellTest1.doc", vbNullString, vbNullString, SW_MAXIMIZE ShellExecute Me.hwnd, "open", path$ & "\ShellTest2.doc", vbNullString, vbNullString, SW_MAXIMIZE End Sub





Reply With Quote