We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Can i put file in bookmark

i want to change content of my bookmark with file .doc or .xls or pdf
it's possible and how can i do ?

and the second think how can i add document in a specific location?

3 Replies

DB Dilli Babu Nandha Gopal Syncfusion Team December 14, 2018 04:51 PM UTC


Greetings from Syncfusion. 
Regarding modifying bookmark in a document: 
Please find the documentation links illustrates working with bookmark in a document. 
Microsoft Excel itself does not have support for bookmarks. So, bookmarks support is not in XlsIO.  

Regarding adding a document in a specific location: 
The following code example illustrates how to replace a particular text with a Word document. 
//Loads a template document 
WordDocument document = new WordDocument("SourceTemplate.docx", FormatType.Docx); 
//Gets the document to replace the text 
IWordDocument replaceDocument = new WordDocument("Template.docx"); 
//Replaces a particular text with another document 
document.Replace("paragraph", replaceDocument, false, true, true); 
//Saves and closes the document 
document.Save("Sample.docx", FormatType.Docx); 

To know more about this, kindly refer the following UG documentation. 

Dilli babu. 

AA AAYADI December 14, 2018 05:01 PM UTC

thanks for answer, i found the solution with replace. :)
but the solution is not working with my document (if i have a bookmarks without  content) => I post the question in the incident.

i need an important think ,
how can i add paragraph or some think in a specific place of document without creating a section.

DB Dilli Babu Nandha Gopal Syncfusion Team December 19, 2018 01:11 PM UTC

Hi Aayadi, 

On further analyzing in depth with the input Word document, we have found that the bookmark is preserved inside the “SET” field. As per Microsoft Word application behavior, SET field doesn’t preserves the field result in the appearance. So, the inserted bookmark contents not preserved in your input Word document while inserting contents using DocIO. 

If your requirement to insert a bookmark contents in the Word document means, we suggest you to set bookmark in the Word document and insert the contents as per the below UG documentation: 

Dilli babu 

Live Chat Icon For mobile
Up arrow icon