[Solved] macro: Close multiple files

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
Math
Posts: 89
Joined: Mon Oct 29, 2018 6:32 pm

[Solved] macro: Close multiple files

Post by Math »

Greetings,

          I need a LibreOffice macro to close 5 files (B, C, D, E, F) that were opened by a macro suggested by mr. Lupp > viewtopic.php?f=20&t=95791

          after closing the 5 files (B, C, D, E, F), the macro should Save file A and close file A.


thank you very much.
Last edited by Math on Mon Nov 12, 2018 11:22 pm, edited 2 times in total.
LibreOffice 5.4.4.2 on Windows 7
FJCC
Moderator
Posts: 9248
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: macro: Close multiple files

Post by FJCC »

I assume you have objects referring to the documents, as suggested in Lupp's answer on the linked thread. All you have to do then is write lines like

Code: Select all

docB.close(TRUE)
docC.close(TRUE)
.
.
.
and to save docA

Code: Select all

docA.store()
docA.close(TRUE)
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Math
Posts: 89
Joined: Mon Oct 29, 2018 6:32 pm

Re: [Solved] macro: Close multiple files

Post by Math »

thank you very much sr. FJCC ,

hugs.
LibreOffice 5.4.4.2 on Windows 7
Post Reply