We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

One bookmark should update multiple cross references

I am trying to Find the bookmark then update the cross references pointing to that specific BookMark. The cross reference looks like this {REF YourBookMarkName} this seems to work only if you highlight the text manually and create a bookmark out of it then create a CrossReference. Afterwards, it will update the CrossReference with the bookmark value if you put your cursor on it, and hit F9.

Microsoft.Office.Interop.Word.Document document.Bookmarks[BookMarkName].Select();

Application applicaton.Selection.TypeText(ValueToReplace);

//Loop over all the cross references and update them
for(int j = 1; j <= docu.Fields.Count; j++)
{
var Myfield = docu.Fields[j];
Myfield.Update()
}

Hi there,

Thansk for your inquiry. Please read about Aspose.Words document object model from here:
Aspose.Words Document Object Model

Bookmark is a "facade" object that encapsulates two nodes BookmarkStart and BookmarkEnd in a document tree and allows to work with a bookmark as a single object. The contents of bookmark are between these two nodes.

Please use Bookmark.Text property to get/set the bookmark's text and use Document.UpdateFields method to update the fields.

If you still face problem, please share your input and expected output documents here for our reference. We will then provide you more information about your query along with code.