Hello,
I would like to execute the command "findAll" in a Javascript Macro. In
Basic, one can access thisComponent and access its findAll method (See [1])
However, the exposed Javascript API does not have thisComponent. I tried
importClass(Packages.com.sun.star.frame.XDesktop)
var currentComp = XDesktop.getCurrentComponent()
to get the current document (as described in [2]) but it failed
silently [3].
I also tried
var desktop = XSCRIPTCONTEXT.getDesktop();
var comp = desktop.getCurrentComponent();
…which gives me something, but that returned object does not have the
findAll-Method.
How to run findAll() in a JS Macro?
Kind regards,
Jan
[1] p405 of OpenOffice.org Macros Explained, http://www.pitonyak.org/book/
[2] http://www.pitonyak.org/AndrewMacro.odt, section 3.6.9.2)
[3] and, if manually evaluated, by printing some number like 361 in the
console. Whyever.
Context
- Macro in JS: How to access ThisComponent-equivalent, run findAll · jan
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.