【发布时间】:2016-04-03 13:44:57
【问题描述】:
在 Writer 中,我想搜索一些文本,并在找到后将视图定位到视图/窗口的顶部。
使用下面的代码,
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim args1(1) as new com.sun.star.beans.PropertyValue
args1(0).Name = "SearchItem.SearchString"
args1(0).Value = ":"
dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, args1())
视图发生了变化,它显示了选择,但它不在任何特定的位置。我希望它位于窗口/视图的顶部。
我还在其他地方发现了 ThisComponent.currentController.getViewData() 和 restoreViewData() 的用法。因此,我进行了实验并确定了如何更改返回的数据以获得垂直滚动,但没有任何反应。比如……
vd = ThisComponent.currentController.getViewData()
vdParts = Split(vd, ";")
vdParts(6) = CLng(vdParts(6)) + 1000
vd = join(vdParts, ";")
ThisComponent.currentController.restoreViewData(vd)
有什么建议吗?
PS:我在 Windows 7 x64 上运行版本 5.0.5.2
【问题讨论】:
标签: openoffice.org libreoffice openoffice-basic libreoffice-basic