SaveAs2(FileName, FileFormat, LockComments, Password, AddToRecentFiles, WritePassword, ReadOnlyRecommended, EmbedTrueTypeFonts, SaveNativePictureFormat, SaveFormsData, SaveAsAOCELetter, Encoding, InsertLineBreaks, AllowSubstitutions, LineEnding, AddBiDiMarks, CompatibilityMode) Let’s go to MSDN: Document.SaveAs2 Method (Word) Done!īut you’re not finished yet, the recorded code has no trace of password related activity.Īlright. Stop macro recording.Ĭopy this code into whatever your VBA macro will be. Now, you will be asked to type in a password. click that and check the box “Encrypt the document with a password”. You will see an “Options…” button appear. Start a macro recorder, go to: File / Save as. So, you were asked to add a macro to Excel or Word to save a document as password protected / encrypted PDF.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |