Hier ist noch der vollständige code, falls jemand das gleiche Problem hatte wie ich.
Private Sub CommandButton1_Click()
Dim strOrdner As String
Dim oFileDialog As FileDialog
Set oFileDialog = Application.FileDialog(msoFileDialogSaveAs)
' Dialog
With oFileDialog
.InitialFileName = ActiveDocument.Path & "\"
.Title = "Beschreibung"
.FilterIndex = 7 'PDF
If .Show = -1 Then
strOrdner = .SelectedItems(1)
If Right(strOrdner, 1) <> "\" Then strOrdner = strOrdner
Else
strOrdner = ""
End If
End With
ActiveDocument.ExportAsFixedFormat OutputFileName:=strOrdner, ExportFormat:=wdExportFormatPDF, _
OpenAfterExport:=False, OptimizeFor:=wdExportOptimizeForPrint, Range:= _
wdExportAllDocument, From:=1, To:=1, Item:=wdExportDocumentContent, _
IncludeDocProps:=True, KeepIRM:=True, CreateBookmarks:= _
wdExportCreateNoBookmarks, DocStructureTags:=True, BitmapMissingFonts:= _
True, UseISO19005_1:=False
End Sub
|