Hi,
We are using Aspose component to manipulate word document from windows application and we need to save these document as read only after replacing bookmark in that document, below is a code snippet to give some idea. We need to mark this file attribute as read only once we save this document so that in the next line when we open that document explicitly using Process.Start it should be in read only mode when user view that. tried document
doc.ViewOptions.ViewType =ViewType.Reading;
doc.Protect(ProtectionType.ReadOnly); but not achive the task.
// here is the code
Document doc = new Document(templateFileName);
doc.Range.Replace(new Regex(" "), new ReplaceEvaluator(ReplaceBookmark), false);
doc.Save(outfileDirectory + "BookmarkExample2.doc");
// Document doc1 = new Document(outfileDirectory + "BookmarkExample Out.doc");
doc.ViewOptions.ViewType =ViewType.Reading;
doc.Protect(ProtectionType.ReadOnly);
Process.Start(outfileDirectory + "BookmarkExample2.doc");