Dependencies:
DocumentFormat.OpenXml.dll (version 2.0.3930.0)
Imports:
DocumentFormat.OpenXml.WordProcessing
DocumentFormat.OpenXml.Packaging
Code Snippet
- Private Sub DeleteFormProtection(ByRef myDoc As WordprocessingDocument)
- Dim formProts As List(Of FormProtection) = myDoc.MainDocumentPart.Document.Descendants(Of FormProtection)().ToList()
- For Each formProt As FormProtection In formProts
- formProt.Remove()
- Next
- myDoc.MainDocumentPart.Document.Save(myDoc.MainDocumentPart.GetStream(FileMode.Create))
- End Sub
No comments:
Post a Comment