Hi all,
I search a way how to save/export a file to pdf and I need use a content from bookmark_1 (a content of bookmark_1 is in at Userform).
After pressing the green button, Word already saves the file where I need it, but I'm having trouble with the name. I would like to have the content of bookmark_1 displayed after the underscore. Thank you for your help
Snímek obrazovky 2022-08-13 190047.jpg
Dim strName As String
ChangeFileOpenDirectory "C:\Users\coufa\Desktop\1"
ActiveDocument.ExportAsFixedFormat OutputFileName:= _
"C:\Users\coufa\Desktop\1\Konformitätserklärung eines externen Anbieters_186188" & "_" & ActiveDocument.Bookmarks("Bookmark_1").Range.Text & ".pdf" _
, ExportFormat:=wdExportFormatPDF, OpenAfterExport:=True, OptimizeFor:= _
wdExportOptimizeForPrint, Range:=wdExportAllDocument, From:=1, To:=1, _
Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True, _
CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
BitmapMissingFonts:=True, UseISO19005_1:=False