Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create password protected docx file #546

Closed
kasinau opened this issue Jun 7, 2015 · 4 comments
Closed

Create password protected docx file #546

kasinau opened this issue Jun 7, 2015 · 4 comments

Comments

@kasinau
Copy link

kasinau commented Jun 7, 2015

Hi, I want to create a docx file from a template and protect it to be able to open only entering a password.
Is it possible with PHPWord or no?
Thank you!


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@dsxack
Copy link

dsxack commented Jun 9, 2015

@kasinau , 👍

It no possible now 😞

@haitruong219
Copy link

haitruong219 commented May 26, 2018

i used 0.14 version and setPassword protection, but when i open the word file, this is not required enter pass word
Here:
image
I want like to bellow:
image
I can?
My Office is 2013:
My code:
require_once 'vendor/autoload.php'; $phpWord = new \PhpOffice\PhpWord\PhpWord(); $documentProtection = $phpWord->getSettings()->getDocumentProtection(); $documentProtection-setEditing(PhpOffice\PhpWord\SimpleType\DocProtect::READ_ONLY); $documentProtection->setPassword('123456');

Sorry for my bad English!

@troosan
Copy link
Contributor

troosan commented May 26, 2018

no, that's not possible. you can only make a document (or parts of it only) read-only.
Forbidding to open a document is much more difficult than that as the whole document needs to be encrypted.

@troosan troosan closed this as completed May 26, 2018
@akellaweb
Copy link

I have not protected template Word document.
I need to edit it and then to set protection with password to avoid changes.
How could I do it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants