根据我在微调 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