0

With the advice I received in fine tuning a goto bookmark libreoffice macro and here too, I had successfully created a macro that in LibreWriter went to the last point where the cursor was at the end.

After upgrading from Kyubuntu 17.04 to Kubuntu 17.10, with the new version of LibreOffice I get an error message, not in Writer, not in Calc, but in Base:

BASIC runtime error. Property or method not found: supportsService

and is highlighted the line If NOT thisComponent.supportsService (" com.sun.star.text.TextDocument ") Then. Apparently supportsService is not recognized in LibreBase.

I refer to the whole macro:

sub vai_qui
    If NOT ThisComponent.supportsService ("com.sun.star.text.TextDocument") Then
        Exit Sub
    End If

    oBookmarks = ThisComponent.getBookmarks ()
    If NOT oBookmarks.hasByName ("here") Then
        Exit Sub
    End If


    ViewCursor = ThisComponent.CurrentController.getviewCursor ()
    Bookmark = ThisComponent.Bookmarks.getByName ("here") .Anchor
    ViewCursor.gotorange (Bookmark, False)

    ViewCursor = ThisComponent.CurrentController.getviewCursor ()
    Bookmark = ThisComponent.Bookmarks.getByName ("here") .Anchor
    ViewCursor.gotorange (Bookmark, False)
end sub
Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73
Duns
  • 1
  • 4

1 Answers1

0

"BASIC runtime error."

This is not a BASE error, it's a BASIC error. Two very different things. BASE is the database component of LO. BASIC is a programming language that can be used to automate LO components in general, e.g. it works with Writer, Calc, Draw, Base, ...

Elliptical view
  • 3,338
  • 1
  • 31
  • 28