I have a web browser control (wbFile) that will display a file on a form. The control source of the WBC is to a text field (txtFileLocation) that will contain the file location. I have a button (cmdBrowse) that is used as a browse function to open file dialog.
I have created what I wanted. Except I'm a little unsure on how I can make a file default on form open. Here is my 'on click' event for my button:
How can I make a file (of my choice) a default, so that the file is already displayed when the form is opened?
I have created what I wanted. Except I'm a little unsure on how I can make a file default on form open. Here is my 'on click' event for my button:
Code:
Private Sub cmdBrowse_Click()
Dim file As FileDialog
Set file = Application.FileDialog(msoFileDialogFilePicker)
file.AllowMultiSelect = False
If file.Show Then
Me.txtFileLocation = file.SelectedItems.Item(1)
End If
End Sub
How can I make a file (of my choice) a default, so that the file is already displayed when the form is opened?