UNO syntax for macro

Hello all,

I would like to open a chm file via a button. For that I will need a macro calling uno:opendocument/webpage.
The below does not work, guess its because the argument in a control property is called URL. Anyone in the know of the proper syntax, thanks.

Sub ohlp
dim document as object
dim dispatcher as object
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService(“com.sun.star.frame.DispatchHelper”)
dispatcher.executeDispatch(document, “.uno:Open document/web page”, “xmpqplus.chm”, 0, Array())
End sub

Hello,

Here is a list of dispatch commands → Development/DispatchCommands. Do not see the command you specify. Where did you get that command from?

A separate issue, from your question in the other forum, you should also look at this post → best macro to detect the operating system

@ Ratslinger,

Thanks for the link. I just picked the command from the Action property of a button, thought it would work because I use some uno commands like save and refresh sometimes within some macros.
Thanks also for the detect OS macro link.

The OS macro is a beauty. For Uno I also checked help/uno-commands.csv at master · LibreOffice/help · GitHub , but its not there either

@gkick,

Should be just opening the file with a Shell command. Need to use correct program to open. On Linux I used xCHM to view (did not actually test with macro but no reason to believe it would not work). Here are some for Windows → .chm Extension - List of programs that can open .chm files

Thanks, much appreciated, will investigate.