Salve non riesco proprio a trovare la soluzione ;-(

ho creato una macro per eseguire delle modifiche sistematiche a file di word, questa parte della macro funziona correttamente.
Non sono riuscito, invece, ad implementare la parte relativa il salvataggio sistematico in formato pdf.

la macro che si auto compila è questa:

Sub salva_pdf_nome_pos_attuale()
'
' salva_pdf_nome_pos_attuale Macro
'
'
ActiveDocument.ExportAsFixedFormat OutputFileName:= _
"C:\Users\16fra\Desktop\prova.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
ActiveDocument.Save
End Sub

ho provato a correggerla sostituendo l'intero indirizzo del file con -OutputFileName:=PercFile & "\" & Name & " .pdf" -

Sub salva_pdf_nome_pos_attuale()
'
' salva_pdf_nome_pos_attuale Macro
'
'
ActiveDocument.ExportAsFixedFormat OutputFileName:=PercFile & "\" & Name & " .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
ActiveDocument.Save
End Sub

ma non ha funzionato...

Vorrei rendere la macro indipendente dal nome e dalla destinazione del file con cui la ho genereata.

Grazie

Buona serata a tutti ;-)