Hi, what code would I put on a button on a form that would allow a user to specify the location of a file on a harddrive and then assign that file to another button that has this code on it to open the specified file:
Private Sub Command273_Click()
On Error GoTo Err_Command1_Click
Dim stAppName As String
Dim fileName As String
'the location of the file set to the button below
fileName = "this location to be set"
'the location of the explorer.exe
stAppName = "C:\winnt\explorer.exe " & tiffName
Call Shell(stAppName, 1)
Exit_Command1_Click:
Exit Sub
Err_Command1_Click:
MsgBox Err.Description
Resume Exit_Command1_Click
End Sub
Does that make sense?
Ps. It would also be great to be able to input a name for the newly specified link on a textbox
many thanks.
Private Sub Command273_Click()
On Error GoTo Err_Command1_Click
Dim stAppName As String
Dim fileName As String
'the location of the file set to the button below
fileName = "this location to be set"
'the location of the explorer.exe
stAppName = "C:\winnt\explorer.exe " & tiffName
Call Shell(stAppName, 1)
Exit_Command1_Click:
Exit Sub
Err_Command1_Click:
MsgBox Err.Description
Resume Exit_Command1_Click
End Sub
Does that make sense?
Ps. It would also be great to be able to input a name for the newly specified link on a textbox
many thanks.