Hi,anybody get the phpWord setPassword() to work?, been trying and it won’t set password. I can set the document as readonly, but not password protect to open
$phpWord = \PhpOffice\PhpWord\IOFactory::load("$infile");
$documentProtection = $phpWord->getSettings()->getDocumentProtection();
$documentProtection->setEditing('readOnly');
$documentProtection->setPassword("$encryption_key");
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
$objWriter->save("$infile");