DOCXReadWrite - DOCX.Editor.Clear takes too long

Questions and answers on how to use DOCXReadWrite
Post Reply
DiBase
Posts: 13
Joined: Wed Feb 16, 2022 9:41 pm

DOCXReadWrite - DOCX.Editor.Clear takes too long

Post 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
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

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

Post by larsa »

Hello

Sorry, I don't think so.
Lars Arvidsson, Axolot Data
DiBase
Posts: 13
Joined: Wed Feb 16, 2022 9:41 pm

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

Post by DiBase »

Thank you for your quick answer - even if it is not very helpful ...

- Dirk
DiBase
Posts: 13
Joined: Wed Feb 16, 2022 9:41 pm

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

Post 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
Post Reply