如何使用宏在Mac OS X上将MS word(docx)保存为安全/锁定PDF

问题描述 投票:0回答:1

我有一个关于如何修改下面的宏的问题,以便将PDF保存为安全(即锁定以进行编辑)PDF。此宏适用于Mac上的Word 2011和2016。

Sub SaveActiveDocAsPDF()

On Error Resume Next

Dim saveName As String
saveName = ActiveDocument.FullName
saveName = Left(saveName, Len(saveName) - 5) & ".pdf"

ActiveDocument.SaveAs fileName:=saveName, _
FileFormat:=wdFormatPDF
End Sub

先感谢您。

vba ms-word word-vba word-2016
1个回答
0
投票

如果不使用第三方插件,您将无法导出受密码保护的PDF。 Word本身不支持此功能,当使用PDF作为文件格式时,Document.SaveAs2 Method不会评估Password参数。

有关详细信息,请查看Microsoft社区:Save password protected PDF file with VBA

但是有几个第三方软件可以像PDFCreator一样使用。

© www.soinside.com 2019 - 2024. All rights reserved.