Monthly Archives: January 2013

Working with Word and OpenXML

When working with Word documents using the OpenXML SDK, it’s not obvious how to remove document protection. The following code shows you how: using (WordprocessingDocument wordDocument = WordprocessingDocument.Open("[path to Word document]", true)) { DocumentFormat.OpenXml.OpenXmlElement protectedDocElement = wordDocument.MainDocumentPart.DocumentSettingsPart.ChildElements.FirstOrDefault(el => el.XmlQualifiedName.Name.Equals("documentProtection")); if … Continue reading

Posted in Office, SharePoint | Tagged , , | Leave a comment

Web Config Updates

The SPWebConfigModification class for SharePoint provides an easy way of updating the web config for a web application. Sometimes, however, I’ve seen it used incorrectly. For example, it’s not advisable to try and write to the web config on Web … Continue reading

Posted in Configuration, SharePoint | Tagged , | Leave a comment