VBA 将工作表保存为受密码保护的 PDF

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12373631/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 17:41:34  来源:igfitidea点击:

VBA to save a sheet to a password protected PDF

excel-vbapdf-generationexcel-2010vbaexcel

提问by whytheq

The following saves the activesheet as a PDF:

以下将活动表保存为 PDF:

ActiveSheet.ExportAsFixedFormat _
                               Type:=xlTypePDF, _
                               Filename:="C:\blahblah2.pdf",  _
                               Quality:=xlQualityStandard, _
                               IgnorePrintAreas:=False, _
                               OpenAfterPublish:=False

I need to be able to create a password protected PDF - is this possible using VBA without buying any additional software?

我需要能够创建受密码保护的 PDF - 这是否可以使用 VBA 而无需购买任何其他软件?

采纳答案by whytheq

I used PDFsharpusing VS- my project is in C#... this free library works very well

PDFsharp使用过VS- 我的项目在C#......这个免费库运行良好