TWPRichText -load-save docx - with EXTRA INTERNAL table borders

  • Hello :)

    I'm trying the do the following using TWPRichText:

    1. Load doc1 from file:

    1. var
    2. doc1, doc2: TWPRichText;
    3. ............
    4. doc1.LoadFromFile('souce.docx');
    5. doc1.Header.PageSize := wp_DinA4;
    6. doc1.ReformatAll();

    2. Save doc1 to file:

    1. doc1.SaveToFile('test1.docx');

    3. Copy doc1 to doc2 using the following code:

    4. Save doc2 to file:

    1. doc1.SaveToFile('test2.docx');

    I open the three files (source.docx, test1,docx, test2.docx) in MSWord.

    Please follow the link to see the screenshots of the files open in MSWord:

    <edit: sorry we do not allow links for security reasons>

    The saved files (test1.docx and test2.docx) the internal borders of the main table are visible.

    They are not visible in the original file (source.docx)

  • Hi,

    The problem is with WPTools 7.

    Here in the sample I copy the the file just for test - to see if the same effect will appear:

    "test1.docx" - without copy

    "test2.docx" - with copy

    But in my main application I need to keep original WPRichText unchanged as a "template" and have copies of it which I will modify with some dynamic data.


    I had a source.rft file and saved it as source.docx using MSWord (no changes - just SaveAs...) because I need to work with .docx from now on in my application.

    So I use this source.docx

    I don't have this problem with source.rtf file - table is fine there.

    Best Regards

  • Thanks for the reply.

    1. About the table - You mean this property should be set during creating of the .rtf-document in MSWord, right ?

    this is about the "shrink-ed" columns/cells ?

    2. And what about the docx-document problem - the inner borders are hidden in the original document but visible in the document saved by WPTools?

    Best Regards

  • As far as I can see is your table auto sized and centered. That is not supported by wptools.

    I can create a table like yours in MS Word and save it and it loads correctly, if I size it manually and use an negative left and right indent so it is larger than the page area.

  • Hi,

    Thank you for the guidance :)

    We made some experiments with size of table, columns and cells and we've managed to get what we need with .rtf-template :)

    Do you have any idea about the other problem I described - with .docx-template:

    Some inner borders of the table which are set to be invisible in the template and after wptools processing the are visible.

    I've tried to hide/show all borders together, one-by-one etc. - but unfortunately no effect.

    It would be great if you could give some advice.

    Best Regards