WPCubed Product Support

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

Hello 🙂

I'm trying the do the following using TWPRichText:

  1. Load doc1 from file:
var
   doc1, doc2: TWPRichText;
   ............

   doc1.LoadFromFile('souce.docx');
   doc1.Header.PageSize := wp_DinA4;
   doc1.ReformatAll();
  1. Save doc1 to file:
   doc1.SaveToFile('test1.docx');
  1. Copy doc1 to doc2 using the following code:
procedure TForm1.CopyDoc(source, dest: TWpRichText);
begin
  with dest do
  begin
    Assign( source );
    FastCopyProperties( source );
    Align := source.Align;
    ViewOptions := source.ViewOptions;
    InsertPointAttr.Assign(  source.InsertPointAttr );
    AutomaticTextAttr.Assign( source.AutomaticTextAttr );see the attached 
    InsertPointAttr.Assign  ( source.InsertPointAttr );
    ProtectedTextAttr.Assign( source.ProtectedTextAttr );
    ProtectedProp     := source.ProtectedProp;
    PrintParameter    := source.PrintParameter;
  end;
end;
  1. Save doc2 to file:
 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)

#1 ✎ ♥ 0
6.9k Views 2 users read 4 min
wpsupport

If this problem happens with WPTools 9 you may send a sample to the support mail:

But I expect that the original table uses special word features. Tables are handled a bit differently there.

Why do you copy the file?

It is possible to make a second WPRichText use exactly the same text as the first WPRichText. See: "splitscreen".

#2 ♥ 0

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.

FYI:

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

#3 ✎ ♥ 0
wpsupport

Well, as said. You can mail me the docx which has a problem and I check it out.

#4 ♥ 0
wpsupport

WPTools docx import supports indentation of tables, also negative, but they have to be specified in the document and must not be automatic. From the file you sent I see that it does not use the tblInd property, so the DocX import does not know how to handle it.

#5 ♥ 0

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 ?

  1. 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

#6 ✎ ♥ 0
wpsupport

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.

#7 ♥ 0

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

#8 ♥ 0
This category is archived. No new posts are possible.