I came back here to irritate @karolus and @KamilLanda. I think this will be a more complex macro and it will need more IQ and smartness.
I am using Ubuntu 22.04 and Version: 24.2.6.2 (X86_64)
/ LibreOffice Community
Build ID: ef66aa7e36a1bb8e65bfbc63aba53045a14d0871
CPU threads: 20; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: en-IN (en_IN); UI: en-US
Calc: threaded
In the attached document file, from IN THE COURT OF to the very next table there is order sheet of one court case. In the given example the first order sheet on second page is bigger in size so it is not adjusted on the first page. But the next order sheet can be adjusted on the first page. So I want to know is it possible to create a macro by running it, it will search for number of blank lines on the page and cut and paste the order sheet of a court case which is smaller in size than the blank lines. The order sheet might be anywhere in the document below the blank lines.
After filling the first page if there is blank space below another pages it will again search for order sheets of court cases which is smaller in size than the blank space on the pages.
(Please note this macro will be used by thousands of people everyday to save time and pages.) Presently the part of blank pages got wasted.
Exp.odt (41.8 KB)
I uploaded the desired copy. I am facing another problem which I asked in another question that when I download a file from our software, since LibreOffice 22 it is giving an error and I have to save the file twice. Anyways in this file blank space can be identified at the bottom of first page and the block is from IN THE COURT OF till first complete table.