The following simple macro does move the View and Text cursors, but the document does not scroll to their position.
Sub eofTEST
dim dispatcher, oText as Object
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
oViewCursor = ThisComponent.CurrentController.ViewCursor
Dim oTextCursor
oText = ThisComponent.Text
oTextCursor = oText.createTextCursorByRange(oViewCursor)
Rem go to doc end:
oViewCursor.gotoEnd(False)
oTextCursor.gotoRange(oViewCursor, False)
Rem All this seems to work, but doc does not SCROLL to the cursors
end Sub
Also, a simple recorded macro, capturing Ctrl-End, does not work either:
sub EOF_TEST1
dim document as object
dim dispatcher as object
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(document, ".uno:GoToEndOfDoc", "", 0, Array())
end sub
So how does one scroll a Writer document to the current position of one of the macro cursors?
Thanks much.