• Re: unprotect a word document

    From Madina Saitakhmetova@21:1/5 to All on Mon Oct 4 07:40:45 2021
    If someone stumbled on this post like me trying to do Protect/Unprotect in Powershell with the option “Filling in Forms” to prevent users from editing the content outside the fillable areas, I am adding the code that worked for me:

    $ProtectionType = [Microsoft.Office.Interop.Word.WdProtectionType]::wdAllowOnlyFormFields

    $objWord = New-Object -comobject Word.Application
    $objDoc = $objWord.Documents.Open("E:\Files\WordDocument.docx") $objDoc.Activate();
    $objDoc.Unprotect();

    /// do what you need to do

    $objDoc.Protect($ProtectionType,$True);

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Madina Saitakhmetova@21:1/5 to All on Mon Oct 4 07:25:58 2021
    If someone stumbled on this post like me trying to do Protect/Unprotect in Powershell with the option “Filling in Forms” to prevent users from editing the content outside the fillable areas, I am adding the code that worked for me:

    $ProtectionType = [Microsoft.Office.Interop.Word.WdProtectionType]::wdAllowOnlyFormFields

    $objWord = New-Object -comobject Word.Application
    $objDoc = $objWord.Documents.Open("E:\Files\WordDocument.docx") $objDoc.Activate();
    $objDoc.Unprotect();

    /// do what you need to do

    $objDoc.Protect($ProtectionType);

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)