BookmarkAdd Method |
Namespace: SIC.OpenDocumentFormat.MSWord
//* 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.Bookmark.Add("BookmarkTest", lSections); lDOC.Bookmark.Add("BookmarkTestIntoTable", lSections); lDOC.Close();