Try:
Code:
Sub PDF()
' pdf Macro
Dim StrName As String
With ActiveDocument
StrName = .FullName
StrName = Left(StrName, InStrRev(StrName, ".")) & "pdf"
.ExportAsFixedFormat OutputFileName:=StrName, UseISO19005_1:=False, _
ExportFormat:=wdExportFormatPDF, OptimizeFor:=wdExportOptimizeForPrint, _
OpenAfterExport:=True, Range:=wdExportAllDocument, From:=1, To:=1, _
Item:=wdExportDocumentContent, IncludeDocProps:=True, _
KeepIRM:=True, CreateBookmarks:=wdExportCreateNoBookmarks, _
DocStructureTags:=True, BitmapMissingFonts:=True
End With
End Sub
PS: When posting code, please use the code tags. They're on the 'Go Advanced' tab.