Feature to send tag that should not be generated in the document

I want to send a tag like ‘Example_line’ which have value ‘This is a text line’ and i am sending the tag to the document.
Now in the document this tag is already mapped. But i don’t want to show this tag to generated document.
Can you please let me know is there any way to achieve this.
Thank you.
Document is like: Screenshot (127).png (70.9 KB)
Code that i am sending: Screenshot (129).png (91.5 KB)

Now when that sample.docx is generated i want to replace the tag with blank value and i don’t want to misplace the numbering of the document also.
Now please guide me what to do. I can explain if you didn’t understand.

@aditya812,

Thanks for your inquiry. 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 attach the expected output Word file that shows the desired behavior.
  • Please create a standalone console application (source code without compilation errors) that helps us to generate the output document that shows the undesired behavior.

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

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

Hello Tahir,
Thanks for your reply. I am adding the console app.
In the example I don’t want to send a field “MPS_AppendixA_2_2” to the document. But i want to generate the document and so it shows error.
Can you please tell me is there any way to achieve it.
AsposeConsoleApp.zip (369.3 KB)

@aditya812,

Thanks for sharing the detail. We have tested the scenario using latest version of Aspose.Words for .NET 18.2 and have not found any error and list numbering has also not misplaced. We have attached the output document with this post for your kind reference. output.zip (7.5 KB)

If you still face problem, please share following documents for further testing.

  • Please attach the output Word file that shows the undesired behavior.
  • Please attach the expected output Word file that shows the desired behavior.

@tahir.manzoor

Can you see the point 2 missing text. Though this is not an issue but I am curious to know that do we have any way to delete that point two when we have blank value to it. Hope I am clear to the question.
I am not raising a bug or issue I am asking for the approach.
output.zip

Thank you.

@aditya812,

Thanks for sharing the detail. Please refer to the following article.
Using Conditional Blocks

In your case, we suggest you please put the second list item in the conditional block to get the desired output. We have attached the modified document with this post for your kind reference. Example Docx.zip (10.9 KB)

@tahir.manzoor
Thank you for sharing the article and modified document. Actually we have used this approach but we have almost 500’s of tags like this and we can’t put check on all tags every time. Do you have any other suggestion or feature. It will be helpful if you can share something like we can check it on the run time.

If you need more clarification, please let me know.

@aditya812,

Thanks for your inquiry. We have logged a feature request as WORDSNET-16491 in our issue tracking system to remove the list item when data source is null or empty. You will be notified via this forum thread once this feature is available.

We apologize for your inconvenience.

thank you @tahir.manzoor
We have licenced version of Aspose.NET so if you have any another suggestion please let me know.

@aditya812,

Unfortunately, there is no other workaround for this issue. We will inform you via this forum thread once this issue is resolved.

The issues you have found earlier (filed as WORDSNET-16491) have been fixed in this Aspose.Words for .NET 18.10 update and this Aspose.Words for Java 18.10 update.