The default dialog has many options. If you only want to import PDF files, you need only two steps: identify the file, and run the "embed" action. Specifically, if your control is called bofDocument, then:
bofDocument.SourceDoc = Input("Please enter file name")
bofDocument.Action = acOLECreateEmbed
You can of course replace the simple input box by a file browser. The code below implements the basic functionality you want (without error handling).
(°v°)
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
|
Private Sub cmdLoadFile_Click()
With FileDialog(msoFileDialogFilePicker)
If .Show Then
bofDocument.SourceDoc = .SelectedItems(1)
bofDocument.Action = acOLECreateEmbed
End If
End With
End Sub
|