BookmarkAdd Method (String, ListSection) |
Namespace: SOWIDocument.Word
//* declaration SOWIDocument.Word.Helper OpenDocument Word document * SOWIDocument.Word.Document lDOC = new SOWIDocument.Word.Document(DOCXFile);; //* declaration text sections * List<SOWIDocument.Word.Section> lSections = new List<SOWIDocument.Word.Section>(); lSections.Add(new SOWIDocument.Word.Section(SOWIDocument.Word.Section.Types.Text, "Test text 1", pNewParagraph: true)); lSections.Add(new SOWIDocument.Word.Section(SOWIDocument.Word.Section.Types.Text, "Text vor MergeField", pNewParagraph: false)); lSections.Add(new SOWIDocument.Word.Section(SOWIDocument.Word.Section.Types.Text, " ")); lSections.Add(new SOWIDocument.Word.Section(SOWIDocument.Word.Section.Types.MergeField, "TestMergeField1", pNewParagraph: false)); lSections.Add(new SOWIDocument.Word.Section(SOWIDocument.Word.Section.Types.Text, " ")); lSections.Add(new SOWIDocument.Word.Section(SOWIDocument.Word.Section.Types.Text, "Text nach MergeField", pNewParagraph: true)); lSections.Add(new SOWIDocument.Word.Section(SOWIDocument.Word.Section.Types.Text, "New line after merge field")); //* "texts" and "merge fields" write to documentation bookmarks (BookmarkTest and BookmarkTestIntoTable") * lDOC.Bookmark.Add("BookmarkTest", lSections); lDOC.Bookmark.Add("BookmarkTestIntoTable", lSections); lDOC.Close();