Q: How to get the path of all opened spreadsheet documents

Andrew Pitonyak andrew at pitonyak.org
Fri Jun 5 04:15:02 PDT 2015


No time to find the solution now.... But I have done this sort of thing in basic.

You enumerate the open components from the desktop object and check of the component is a calc document.

In your case do you only care about documents that have been saved... Ignoring new never saved to disk docs?

Think I can find a basic example of it helps

On Jun 4, 2015 10:35 PM, "Zhang, William" <william.zhang at ptn.advantest.com> wrote:
>
> Hi,
>
>  
>
> Request:
>
> In RedHat7, I want to get the path of all opened spreadsheet documents with Java.
>
>  
>
> What I’ve done:
>
> 1.       I used Runtime.exec(cmd…) with Java code, the ‘cmd’ was defined with “ps –ef | grep xxx”
>
> ->if only one spreadsheet document opened, the returned info list the correct document, I can parse it and get the file path
>
> ->but if multi spreadsheet documents opened, the returned process still only list the first document, I cannot get other documents.
>
>        2.  I also test in bash, it seems “ps -ef” cannot list all files.
>
>  
>
> So , I want to know is there any other way to do it. such as using UNO service with libreoffice API to get it.
>
> Anyone who knows it is much appreciate.
>
>  
>
> Best Regards
>
> William
>
>  


More information about the LibreOffice mailing list