Date: prev next · Thread: first prev next last
2017 Archives by date, by thread · List index


On 15.03.2017 22:32, jan wrote:
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.

did you try the getDocument() method?

http://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1script_1_1provider_1_1XScriptContext.html#a191c375534e4ecbb1309581035eca1c6


Context


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.