Hello 🙂
I'm trying the do the following using TWPRichText:
- Load doc1 from file:
var
doc1, doc2: TWPRichText;
............
doc1.LoadFromFile('souce.docx');
doc1.Header.PageSize := wp_DinA4;
doc1.ReformatAll();
- Save doc1 to file:
doc1.SaveToFile('test1.docx');
- 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;
- 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)