Closed HamzaBeg closed 6 months ago
The issue comes from the wrong implementation of WordTextBox Text and WordParagraph properties. Those should actually be lists.
This should be fixed in:
Instead of first child we should get all runs and and create List
I am experiencing a problem with the text replacement functionality within multi-line text boxes using OfficeImoWord. Specifically, the function only recognizes and modifies placeholders in the first line of a text box, neglecting any placeholders in subsequent lines. This issue is impacting our ability to generate dynamic documents efficiently, where placeholders span multiple lines within text boxes.
Detailed Issue Description: In scenarios where I attempt to replace placeholders across multiple lines within a single text box, only the placeholders in the first line are detected and replaced. Any subsequent placeholders that match the replacement criteria remain unaffected. This behavior suggests that the text replacement function may not be fully iterating through all text segments within a text box. During my debugging sessions, I found that the TextBoxes array, which should contain all lines of text within a text box, only includes text from the first line. This observation indicates that the function responsible for populating this array might not be capturing the entire content of text boxes, thereby affecting the completeness of the text replacement process.
Code Snippet Demonstrating the Issue:
Here is picture of textbox in word:
and here is result of my code:
Steps to Reproduce: Create a Word document and insert a text box.
Could you please investigate this issue? I would appreciate guidance on whether this is a known limitation, and if there are any potential workarounds or upcoming fixes. Additionally, information on when a fix might be expected would be highly beneficial.
Technical Environment:
OfficeIMO Version: OfficeIMO.Word Version="0.13.0" Operating System: Windows 11