Please see the document attached. We have two problems generating a document like that and I want to ask how to achieve that with Spire.Doc
1. Protection Level:
The closest I can get to the behavior getting by Word is using AllowOnlyFormFields
Then I can Edit the Content of the RichtText Field but can#t use any formatting functions and format templates from the ribbon. This works using the attached (Word generated) file
Even if I take this (attached) document, Load and Save it the Protection Level seems to change as I lose the editing and formatting ability completely
- Code: Select all
Document document = new Document();
document.LoadFromFile(sourceFile);
document.SaveToFile(filename, FileFormat.Docx);
2. How can I a new added StructureDocumentTag get to the editable (not locked) mode like the one in the sample. If I do something like
- Code: Select all
var newsdt = new Spire.Doc.Documents.StructureDocumentTag(document);
newsdt.SDTProperties.Alias = "Test2";
newsdt.SDTProperties.Tag = "Test2_Tag";
//newsdt.SDTProperties.IsShowingPlaceHolder = true;
newsdt.SDTProperties.SDTType = SdtType.RichText;
var sdtpa = newsdt.SDTContent.AddParagraph();
sdtpa.Text = "Das ist der Inhalt des neuen Paragraphs";
document.Sections[0].Paragraphs.Add(sdtpa);
I can’t find a Property where to set the protection of the Richtext field
Best regards