Node ID is lost after setting it with CustomNodeId using .NET

Hello I’m struggling with “CustomNodeId” attribute for “Runs”, it doesn’t seems to work…
Here is a sample of my code (c#) :

        Run run = new Run(document, newContent);
        run.CustomNodeId = 10000000 + num * 100000 + id;
        cellToUpdate.FirstParagraph.Runs.Add(run);

newContent is string text to add inside a cell table
num is an integer between 1 and 9
id is an integer <= 99999

When I re execute my code, if I scry inside the attributes of the existing runs, the previously created run appear but the CustomNodeId is still = 0…

The initial goal is :

  • First execution of the code, the Runs are created and CustomNodeId are set.
  • Future others execution of the code, be able to get those Runs by CustomNodeId very quickly (using Find,Where,etc…).

@Zan135

To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please attach the output Word file that shows the undesired behavior.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

@tahir.manzoor
Ok thanks for your answer, my app is a server side application using other API, so I’m not very familiar of “standalone console application”, do you have a template/model for this kind of things ?
I don’t really have an input and output word document, I’ve got an input Word , and I want to modify this input word so that it’ll become the output.
Another wondering do you want me to insert the Aspose.Words.lic inside the application

@Zan135

We have logged this problem in our issue tracking system as WORDSNET-21916. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

@Zan135

It is to inform you that the issue which you are facing is actually not a bug in Aspose.Words. So, we have closed this issue (WORDSNET-21916) as ‘Not a Bug’.

CustomNodeId property is purposed to be node life time property. Aspose.Words does not preserve its value after re-saving document. MS Word does not have such functionality at all. It is not good idea to add identifiers to output document in some form. At least some formats does not allow to do that e.g. TXT.