You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: knowledge-base/radwordsprocessing-change-bookmark-content-preserve-formatting.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,15 +19,15 @@ This article shows how to change the content of an existing [Bookmark]({%slug ra
19
19
20
20
## Solution
21
21
22
-
***Import DOCX**: Use [DocxFormatProvider]({%slug radwordsprocessing-formats-and-conversion-docx-format-provider%}) to read the input DOCX and obtain a [RadFlowDocument]({%slug radwordsprocessing-model-radflowdocument%}).
22
+
***Import DOCX**: Use [DocxFormatProvider]({%slug radwordsprocessing-formats-and-conversion-docx-docxformatprovider%}) to read the input DOCX and obtain a [RadFlowDocument]({%slug radwordsprocessing-model-radflowdocument%}).
23
23
***Initialize editor**: Create a [RadFlowDocumentEditor]({%slug radwordsprocessing-editing-radflowdocumenteditor%}) for cursor movement and editing.
24
-
***Find bookmark**: Enumerate [BookmarkRangeStart]({%slug radwordsprocessing-model-form-bookmarkrangestart%}) elements and select the bookmark by **Name**.
25
-
***Capture formatting**: Get the first [Run]({%slug radwordsprocessing-model-textfragment-run%}) within the bookmark and copy its **CharacterFormatting** properties.
24
+
***Find bookmark**: Enumerate [BookmarkRangeStart]({%slug radwordsprocessing-model-bookmark%}) elements and select the bookmark by **Name**.
25
+
***Capture formatting**: Get the first [Run]({%slug radwordsprocessing-model-run%}) within the bookmark and copy its **CharacterFormatting** properties.
26
26
***Delete original bookmark content**: Delete only the content between the start and end markers while keeping the bookmark structure intact.
27
27
***Position cursor**: Move the editor back to the start of the bookmark to insert new text in place.
28
28
***Copy formatting**: Apply the formatting of the original bookmark content to the editor properties.
29
29
***Insert text**: Add the replacement content.
30
-
***Export DOCX**: Write the updated document using [DocxFormatProvider]({%slug radwordsprocessing-formats-and-conversion-docx-format-provider%}).
30
+
***Export DOCX**: Write the updated document using [DocxFormatProvider]({%slug radwordsprocessing-formats-and-conversion-docx-docxformatprovider%}).
31
31
32
32
#### [C#] Replace bookmark content but keep formatting
0 commit comments