Free Support Forum - aspose.com

Textbox's text does not move to next linked Textbox After linking them using .NET

Hi Aspose Team,

I have a question regarding link between textboxes. Please see following code:

        var document = new Document();
        var builder = new DocumentBuilder(document);

        var box1 = builder.InsertShape(ShapeType.TextBox, 100, 100);
        var para = box1.AppendChild(new Paragraph(document));
        builder.MoveTo(para);
        for (int i = 0; i < 20; i++)
        {
            builder.Writeln("Some text");
        }
        builder.MoveToDocumentEnd();
        var box2 = builder.InsertShape(ShapeType.TextBox, 300, 300);
        box1.TextBox.Next = box2.TextBox;
        document.Save(@"TextBoxTest.docx");

In output document text is only added to first text box, and despite the fact that it’s overflowed - the second text box remains empty. In Word linking causes text to be moved between text boxes even if one of them is already filled with text.
I’m getting the same result even if I link text boxes first, and only then insert text to the first one.
Following code:

box1.TextBox.IsValidLinkTarget(box2.TextBox);

return true, so they should be linked correctly. Could you please help me out with this?

Thanks,
Mateusz

@acturisaspose

We have reproduced this issue and logged it in our issue tracking system as WORDSNET-20630 . You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

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