Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

avoid error message in Base with a Writer macro

With (your help 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 no more recognized in LibreBase (or, better, in Basic: I don't know!).

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

Could someone help me to avoid the base error message? Thank you

avoid error message in Base with a Writer macro

With (your help 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 Kubuntu 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 no more recognized in LibreBase (or, better, in Basic: I don't know!).

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

Could someone help me to avoid the base error message? Thank you