Section Constructor (SectionType, String, String, Boolean) |
Namespace: SIC.OpenDocumentFormat.MSWord
public Section( SectionType pType, string pValue, string pStyle = "", bool pNewParagraph = false )
//* declaration SIC OpenDocument MS Word document * SIC.OpenDocumentFormat.MSWord.Document lDOC = new SIC.OpenDocumentFormat.MSWord.Document(DOCXFile);; //* declaration text sections * List<SIC.OpenDocumentFormat.MSWord.Section> lSections = new List<SIC.OpenDocumentFormat.MSWord.Section>(); lSections.Add(new MSWord.Section(MSWord.SectionType.Text, "Test text 1", pNewParagraph: true)); lSections.Add(new MSWord.Section(MSWord.SectionType.Text, "Text vor MergeField", pNewParagraph: false)); lSections.Add(new MSWord.Section(MSWord.SectionType.Text, " ")); lSections.Add(new MSWord.Section(MSWord.SectionType.MergeField, "TestMergeField1", pNewParagraph: false)); lSections.Add(new MSWord.Section(MSWord.SectionType.Text, " ")); lSections.Add(new MSWord.Section(MSWord.SectionType.Text, "Text nach MergeField", pNewParagraph: true)); lSections.Add(new MSWord.Section(MSWord.SectionType.Text, "New line after merge field")); //* "texts" and "merge fields" write to documentation bookmarks (BookmarkTest and BookmarkTestIntoTable") * lDOC.BookmarkAdd("BookmarkTest", lSections); lDOC.BookmarkAdd("BookmarkTestIntoTable", lSections); lDOC.Close();