I need record macro help

asked 2018-10-31 06:29:46 +0200

Todd2 gravatar image

lo 6.1.2.1 for linux

I press tools --> record macro. Then I right click on a graph, select Export Image as, pick out an name and PNG, then press save. Then I stop the recorder and save the macro. I get something weird.

What am I doing wrong?

Many thanks, -T

sub Main
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 ----------------------------------------------------------------------
rem dispatcher.executeDispatch(document, ".uno:ExportAsGraphic", "", 0, Array())   
end sub
edit retag flag offensive close merge delete

Comments

What am I doing wrong?

Wrong here is the assumption that LO macro recorder is useful in your case... you'd need to make such a macro from scratch.

Mike Kaganski gravatar imageMike Kaganski ( 2018-10-31 06:33:34 +0200 )edit

@Todd2 in light of your recent questions, if you haven't already, I strongly suggest you download and read Andrew Pitonyak's OpenOffice Macros Explained.

It applies equally well to LibreOffice.

BigRAl gravatar imageBigRAl ( 2018-10-31 18:46:02 +0200 )edit