I want to add 3 lines of text at a bookmark and I have a function that inserts a line of text that I run 3 times. The problem is that it messes up the bookmark indentation and the indentation of the final line of text added. Please can anyone advise how to do this?
This is my code (NB I tried moving to the bookmark and to the end of the bookmark but neither worked):
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.
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.
You are facing the expected behavior of Aspose.Words. The output document is generated according to the code example. Please open the input and output documents and check the paragraph properties.
Could you please ZIP and attach your expected output Word document? We will then provide you more information about your query.
Attached is the kind of output I want to achieve. Note that there are 2 bookmarks and I want to programmatically insert text1, text2, text3, text4, etc. under the relevant bookmark using the bookmark name. Aspose Sample.zip (8.7 KB)
Many thanks.
Please set the ParagraphFormat.FirstLineIndent property as shown below to get the desired output. We have attached the output document with this post for your kind reference. 19.5.zip (19.1 KB)
Thanks so much, however when repeatedly called it inserts with different formatting as per the image below. Is that overcome by inserting a paragraph keep formatting somewhere?
We have tested the scenario using the latest version of Aspose.Words for .NET 19.5 and have not found the shared issue.
We suggest you please set the paragraph formatting before inserting the text and insert the paragraph’s text one by one. Please read the following article. Inserting Document Elements