Page 1 of 1

DOCXReadWrite - DOCX.Editor.Clear takes too long

Posted: Sun Aug 13, 2023 6:12 pm
by DiBase
I ask here again a question to all, even if you get unfortunately rarely an answer ...

I create an approx. 1000-page document, preview it and have a rather long waiting time when closing it.

The command ...

Code: Select all

DOCX.Editor.Clear;
... takes about 3 minutes. :shock:

Is there a better/faster way to delete a document again?

- Dirk

Re: DOCXReadWrite - DOCX.Editor.Clear takes too long

Posted: Mon Aug 14, 2023 12:16 pm
by larsa
Hello

Sorry, I don't think so.

Re: DOCXReadWrite - DOCX.Editor.Clear takes too long

Posted: Mon Aug 14, 2023 3:12 pm
by DiBase
Thank you for your quick answer - even if it is not very helpful ...

- Dirk

Re: DOCXReadWrite - DOCX.Editor.Clear takes too long

Posted: Fri Aug 18, 2023 8:21 pm
by DiBase
I made some improvements ...

The line which takes the longest time is ...

Code: Select all

FLogParas.Clear;
... in procedure TAXWLogDocument.Clear;

I added this line before ...

Code: Select all

FLogParas.Updating := True;
... and 3 minutes go down to 2 minutes.

I also added an event routine in the Clear function for showing a progress bar for the remaining time.

The best solution I found so far.

- Dirk