0

根据我在微调 goto 书签 libreoffice 宏这里收到的建议,我已经成功创建了一个宏,在 LibreWriter 中,它到达了光标最后的最后一点。

从 Kyubuntu 17.04 升级到 Kubuntu 17.10 后,使用新版本的 LibreOffice 我收到一条错误消息,不是在 Writer 中,不是在 Calc 中,而是在 Base 中

BASIC 运行时错误。未找到属性或方法:supportsService

并突出显示该行If NOT thisComponent.supportsService (" com.sun.star.text.TextDocument ") Then。显然supportsService在 LibreBase 中不被识别。

我指的是整个宏:

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
4

1 回答 1

0

“基本运行时错误。”

这不是 BASE 错误,而是 BASIC 错误。两种截然不同的东西。BASE 是 LO 的数据库组件。BASIC 是一种编程语言,通常可用于自动化 LO 组件,例如,它与 Writer、Calc、Draw、Base 等一起使用。

于 2017-10-28T01:10:26.657 回答