<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix"> Zhang<br>
<br>
in basic i use this function<br>
<br>
Function TaskonDesktop(DocPath as String) as Boolean<br>
<br>
Dim oComponents as Object<br>
<br>
' Search if one of the active Components ist the one that you
search for<br>
oComponents = StarDesktop.Components.CreateEnumeration<br>
While oComponents.HasmoreElements<br>
oComponent = oComponents.NextElement<br>
'print UCase(oComponent.URL) & " - " &
UCase(converttoURL(DocPath)<br>
If UCase(oComponent.URL) =
UCase(converttoURL(DocPath)) then<br>
TaskonDesktop = True<br>
Exit Function<br>
End If<br>
Wend<br>
TaskonDesktop = False<br>
End Function<br>
<br>
<br>
hope it helps<br>
<br>
Fernand<br>
</div>
<blockquote
cite="mid:BY2PR05MB19279A75C691291FBD18FA83B4BF0@BY2PR05MB1927.namprd05.prod.outlook.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Plain Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.5pt;
font-family:"Calibri","sans-serif";}
span.PlainTextChar
{mso-style-name:"Plain Text Char";
mso-style-priority:99;
mso-style-link:"Plain Text";
font-family:"Calibri","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
/* Page Definitions */
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoPlainText"><span lang="EN-US">Hi Andrew,<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">Thanks a lot for your
reply.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">Q1: In your case do
you only care about documents that have been saved...
Ignoring new never saved to disk docs?<o:p></o:p></span></p>
<p class="MsoPlainText"><span style="font-family:Wingdings"
lang="EN-US">à</span><span lang="EN-US">What I want to get
is all calc documents as long as the doc is opened, no
matter it have been saved or not.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US"> So firstly, I want
to know if it</span><span style="font-family:"Courier
New"" lang="EN-US">’</span><span lang="EN-US">s
possible to do it in this case. If no, maybe I can only care
the doc which have been saved and ignore which is not saved.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">Q2: You enumerate the
open components from the desktop object and check of the
component is a calc document.<o:p></o:p></span></p>
<p class="MsoPlainText"><span style="font-family:Wingdings"
lang="EN-US">à</span><span lang="EN-US">Sorry, I know how to
get the desktop object, but I am not clear how to get the
open component and check them as you mentioned.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US"> This is my gap,
would you please give example code based on my comment for
Q1?<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">Thanks in advanced!<br>
<br>
<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">Best Regards<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">William<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">-----Original
Message-----<br>
From: Andrew Pitonyak [<a class="moz-txt-link-freetext"
href="mailto:andrew@pitonyak.org">mailto:andrew@pitonyak.org</a>]
<br>
Sent: 2015</span><span style="font-family:宋体">年</span><span
lang="EN-US">6</span><span style="font-family:宋体">月</span><span
lang="EN-US">5</span><span style="font-family:宋体">日</span><span
lang="EN-US"> 19:15<br>
To: Zhang, William<br>
Cc: <a class="moz-txt-link-abbreviated"
href="mailto:libreoffice@lists.freedesktop.org">libreoffice@lists.freedesktop.org</a><br>
Subject: Re: Q: How to get the path of all opened
spreadsheet documents</span></p>
<p class="MsoPlainText"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">No time to find the
solution now.... But I have done this sort of thing in
basic.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">You enumerate the
open components from the desktop object and check of the
component is a calc document.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">In your case do you
only care about documents that have been saved... Ignoring
new never saved to disk docs?<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">Think I can find a
basic example of it helps<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">On Jun 4, 2015 10:35
PM, "Zhang, William" <<a moz-do-not-send="true"
href="mailto:william.zhang@ptn.advantest.com"><span
style="color:windowtext;text-decoration:none">william.zhang@ptn.advantest.com</span></a>>
wrote:<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">> Hi,<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">> </span><span
style="font-family:"Courier New"" lang="EN-US"> </span><span
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">> Request:<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">> In RedHat7, I
want to get the path of all opened spreadsheet documents
with Java.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">> </span><span
style="font-family:"Courier New"" lang="EN-US"> </span><span
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">> What I</span><span
style="font-family:"Courier New"" lang="EN-US">’</span><span
lang="EN-US">ve done:<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">> 1.</span><span
style="font-family:"Courier New"" lang="EN-US"> </span><span
lang="EN-US"> I used Runtime.exec(cmd</span><span
style="font-family:"Courier New"" lang="EN-US">…</span><span
lang="EN-US">) with Java code, the </span><span
style="font-family:"Courier New"" lang="EN-US">‘</span><span
lang="EN-US">cmd</span><span
style="font-family:"Courier New"" lang="EN-US">’</span><span
lang="EN-US"> was defined with </span><span
style="font-family:"Courier New"" lang="EN-US">“</span><span
lang="EN-US">ps </span><span
style="font-family:"Courier New"" lang="EN-US">–</span><span
lang="EN-US">ef | grep xxx</span><span
style="font-family:"Courier New"" lang="EN-US">”</span><span
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">> ->if only one
spreadsheet document opened, the returned info list the
correct document, I can parse it and get the file path<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">> ->but if
multi spreadsheet documents opened, the returned process
still only list the first document, I cannot get other
documents.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">> </span><span
style="font-family:"Courier New"" lang="EN-US"> </span><span
lang="EN-US">2.</span><span style="font-family:"Courier
New"" lang="EN-US"> </span><span lang="EN-US"> I also
test in bash, it seems </span><span
style="font-family:"Courier New"" lang="EN-US">“</span><span
lang="EN-US">ps -ef</span><span
style="font-family:"Courier New"" lang="EN-US">”</span><span
lang="EN-US"> cannot list all files.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">> </span><span
style="font-family:"Courier New"" lang="EN-US"> </span><span
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">> So , I want to
know is there any other way to do it. such as using UNO
service with libreoffice API to get it.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">> Anyone who knows
it is much appreciate.<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">> </span><span
style="font-family:"Courier New"" lang="EN-US"> </span><span
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">> Best Regards<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">> William<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">><o:p> </o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">> </span><span
style="font-family:"Courier New"" lang="EN-US"> </span><span
lang="EN-US"><o:p></o:p></span></p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LibreOffice mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LibreOffice@lists.freedesktop.org">LibreOffice@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freedesktop.org/mailman/listinfo/libreoffice">http://lists.freedesktop.org/mailman/listinfo/libreoffice</a>
</pre>
</blockquote>
<br>
</body>
</html>