A function in my project, opens a report, exports it to pdf, zip and password protect the pdf and sends the protected zip file as an attachment to a client.
No problem here.
This is the code that I use to zip and add a password to the pdf file:
-p parameter is used for adding a password and 123456789 is the password.
Up to here Everything is working perfect.
My problem:
I'm trying to find a way to use a different password each time I run the code. so I changed the code :
The zip password is the word password not the value of it. For example if
Pass=Ab36cp1
the zip password is pass not Ab36cp1
Can anyone enlighten me how to do it?
Many thanks.
No problem here.
This is the code that I use to zip and add a password to the pdf file:
Code:
Shell WinRarPath & " a -afzip -p123456789 -ep " & ZipName & " " & FilenameToBeZipped
-p parameter is used for adding a password and 123456789 is the password.
Up to here Everything is working perfect.
My problem:
I'm trying to find a way to use a different password each time I run the code. so I changed the code :
Code:
Dim Pass as string
Pass=CreatePassword()
Shell WinRarPath & " a -afzip -ppass -ep " & ZipName & " " & FilenameToBeZipped
The zip password is the word password not the value of it. For example if
Pass=Ab36cp1
the zip password is pass not Ab36cp1
Can anyone enlighten me how to do it?
Many thanks.
Last edited: