|
|
Диалог сохранения Файла (msoFileDialog)
Private Function ShowFileDialog(InitPath$) As String
Dim dlgOpen As Object
Dim iResult As Integer
On Error GoTo ShowFileDialog_Error
Set dlgOpen = Application.FileDialog(2)
With dlgOpen
.Title = "Куда сохранять???"
.InitialFileName = InitPath
iResult = .Show
If iResult = -1 Then
ShowFileDialog = .SelectedItems(1)
End If
End With
On Error GoTo 0
Exit Function
ShowFileDialog_Error:
ShowFileDialog = ""
End Function
Пример эксплуатации:
Dim sFilePath$, sInit$
sInit = CurrentProject.Path
sFilePath = ShowFileDialog(sInit & "\о_торг2_1234.pdf")
If sFilePath <> "" Then
DoCmd.OutputTo acOutputReport, "о_торг2_1234", "PDFFormat(*.pdf)", sFilePath, True, , , acExportQualityPrint
End If
|
|