We are creating word document using openxml programatically. Everything works fine but when we protect the document also programactially using openxml for editing then contents of the document are getting affected for example the sentence نحاول اصلاح التقرير اليوم وشكرا will become اليوم وشكرا نحاول اصلاح التقرير
If the generated document is not protected then everything stays fine.
Any help would appreciated.
Thanks in advance.
The code we are using to protec the document is
using (WordprocessingDocument wdoc = WordprocessingDocument.Open(strPath, true))
{
DocumentSettingsPart docSett = wdoc.MainDocumentPart.DocumentSettingsPart;
docSett.RootElement.Append(new DocumentProtection { Edit = DocumentProtectionValues.ReadOnly });
docSett.RootElement.Save();
}