How to get the Horizontal- and Verticalposition from a bookmark?

Hi 

It's possible to get the horizontal and vertical position from a bookmark?

I need to place an shape including an image above the bookmark-position.

Thank you
Stefan




1 Reply

SR Sindhu Ramesh Syncfusion Team February 3, 2025 04:25 PM UTC

Hi Stefan,
The Word document is a flow document in which contents will not be preserved page by page; instead the contents will be preserved sequentially section by section. Each section may extend to various pages based on its contents like table, text, images etc. Word viewer/editor renders the contents of the Word document page by page dynamically when opened for viewing or editing and these page wise rendered information will not be preserved in the document level as per Word file format specification.

Essential® DocIO is a non UI component that provides a full-fledged document object model to manipulate the Word document contents. Therefore, it is not directly possible to access the bookmark position. As a result, inserting an item based on position is not feasible.

If you wish to insert a shape in a Word document, you can insert it at (nth paragraph, nth paragraph item, between text, or in a cell) using the DOM structure.
Refer this UG to know about DOM Structure: Working with Word document in C# | DocIO | Syncfusion®

For working with Word documents, refer to the User Guide (UG).
Overview of .NET Word (DocIO) library | Syncfusion®

Regards,
Sindhu Ramesh.


Loader.
Up arrow icon