EXCEL-VBA:打开word文件转换为PDF保存

Sub a()
    Dim WordApp As Word.Application
    Dim WordDoc As Word.Document
    
    Set WordApp = New Word.Application
    Set WordDoc = WordApp.Documents.Open(ThisWorkbook.Path & "\HAHA1.docx")
    WordDoc.SaveAs ThisWorkbook.Path & "\HAHA1.pdf", wdFormatPDF
    WordDoc.Close
    WordApp.Quit
    Set WordDoc = Nothing
    Set WordApp = Nothing
End Sub

要引用word哦

相关推荐
©️2020 CSDN 皮肤主题: 深蓝海洋 设计师:CSDN官方博客 返回首页