Jump to content

Recommended Posts

Posted

While working on the LibreOffice UDF I have used the following tools quite extensively. In case anybody else would find some help while toying with the LibreOffice API, I thought I would post these tools here. The LibreOffice Xray and MRI extensions allow you to inspect Object and properties in the LibreOffice API. These attached functions allow you to do it directly from an AutoIt Script, instead of having to use a LibreOffice Macro directly. They're nothing fancy.

Either one will work, the Xray tool is the one I primarily use, only because it was the first tool I found, but it doesn’t seem to be maintained much any more. MRI seems to have been more recently updated, and perhaps is still maintained.

Prerequisites

In order to use these tools, you must have LibreOffice Installed, and have either the Xray Tool extension and/or the MRI extension installed according to their respective instructions.

Examples

Xray Tool

#include <MsgBoxConstants.au3>
#include "AU3_LibreOffice_Inspector.au3"

_Example()

Func _Example()
    Local $oServiceManager = ObjCreate("com.sun.star.ServiceManager")
    If Not IsObj($oServiceManager) Then Return MsgBox($MB_OK, "Error", "Failed to create a ServiceManager Object.")

    _AU3_LO_XRAY($oServiceManager)
    If @error Then Return MsgBox($MB_OK, "Error", "Failed to XRay an Object. @Error: " & @error & " @Extended: " & @extended)
EndFunc   ;==>_Example

MRI Tool

#include <MsgBoxConstants.au3>
#include "AU3_LibreOffice_Inspector.au3"

_Example()

Func _Example()
    Local $oServiceManager = ObjCreate("com.sun.star.ServiceManager")
    If Not IsObj($oServiceManager) Then Return MsgBox($MB_OK, "Error", "Failed to create a ServiceManager Object.")

    _AU3_LO_MRI($oServiceManager)
    If @error Then Return MsgBox($MB_OK, "Error", "Failed to MRI an Object. @Error: " & @error & " @Extended: " & @extended)
EndFunc   ;==>_Example

 

Best Regards,

Donny

AU3_LibreOffice_Inspector.au3

LibreOffice UDF  

Scite4AutoIt Spell-Checker Using LibreOffice

WPS Office adapter — Use MS Word UDFs with WPS Office!

LibreOffice API Inspector tools

Spoiler

"Life is chiefly made up, not of great sacrifices and wonderful achievements, but of little things. It is oftenest through the little things which seem so unworthy of notice that great good or evil is brought into our lives. It is through our failure to endure the tests that come to us in little things, that the habits are molded, the character misshaped; and when the greater tests come, they find us unready. Only by acting upon principle in the tests of daily life can we acquire power to stand firm and faithful in the most dangerous and most difficult positions."

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...