Hello,
Not certain what you did. I recorded this and it works fine:
sub pgdn
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:PageDown", "", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:PageDown", "", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:PageDown", "", 0, Array())
end sub
You should look at the documentation. See → Getting Started with LibreOffice. Look at Chapter 13 Getting Started with Macros. Has a section on Recording a Macro.