я хочу сделать саб
Sub Word2pdf(document As document)
Dim objApp As Word.Application
Dim doc As Object
Set doc = Documents.Open(Filename:=document.Name)
doc.ExportAsFixedFormat document.Name & ".pdf", wdExportFormatPDF
doc.ExportAsFixedFormat OutputFileName:=document.Name, _
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
MsgBox "word 2PDF file finished!"
End Sub