Skip to main content

AccessTr.neT


Doc Ve Docx Uzantılı Dosyayı Pdf Formatına Dönüştürme

Doc Ve Docx Uzantılı Dosyayı Pdf Formatına Dönüştürme

#2
Aşağıdaki kodu dener misiniz?



Sub SaveAsPDF()

    Dim strFileName As String
    Dim WordApp As Word.Application

    strpath = "F:\PDF Files\"
    strFileName = "test.docx"


    Set WordApp = CreateObject("Word.Application")
    WordApp.Documents.Open strpath & strFileName
           
'  remove .doc or .docx from filename
    If UCase(Right(ActiveDocument.name, 1)) = "X" Then
'      .docx
        strFileName = Left(ActiveDocument.name, Len(ActiveDocument.name) - 5)
    Else
'      .doc
        strFileName = Left(ActiveDocument.name, Len(ActiveDocument.name) - 4)
    End If

'  write the PDF file
    WordApp.ActiveDocument.ExportAsFixedFormat _
            OutputFileName:=ActiveDocument.Path & "\" & strFileName & ".pdf", _
            ExportFormat:=wdExportFormatPDF, _
            OpenAfterExport:=False, _
            OptimizeFor:=wdExportOptimizeForPrint, _
            Range:=wdExportAllDocument, _
            Item:=wdExportDocumentContent, _
            IncludeDocProps:=True, KeepIRM:=True, _
            CreateBookmarks:=wdExportCreateNoBookmarks, _
            DocStructureTags:=True, _
            BitmapMissingFonts:=True, _
            UseISO19005_1:=False

    WordApp.Quit
    Set WordApp = Nothing

'  all done
    MsgBox "PDF complete"

End Sub
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
Cvp: Doc Ve Docx Uzantılı Dosyayı Pdf Formatına Dönüştürme - Yazar: ozanakkaya - 01/10/2019, 23:06
Task