[Solved] Need Macro that will generate the esc key to exit

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
User avatar
alf50
Posts: 129
Joined: Sun Jun 13, 2010 2:55 pm

[Solved] Need Macro that will generate the esc key to exit

Post by alf50 »

I Need a Macro that will generate the esc key to exit from full screen mode.

Has anyone been able to find such a command?
Last edited by alf50 on Sun Dec 11, 2016 7:38 am, edited 1 time in total.
OpenOffice 4.1.14 on Mac Catalina(10.15.7), RasPi4B (TwisterOS-8/2023update) & MS Wnds10
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Need Macro that will generate the esc key to exit from f

Post by Villeroy »

Macros do not send any keys. Try this:

Code: Select all

sub recorded_FullScreen
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 ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "FullScreen"
args1(0).Value = true

dispatcher.executeDispatch(document, ".uno:FullScreen", "", 0, args1())

rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "FullScreen"
args2(0).Value = false

dispatcher.executeDispatch(document, ".uno:FullScreen", "", 0, args2())


end sub
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Need Macro that will generate the esc key to exit from f

Post by RoryOF »

You may find the links below useful; they provide access to various Windows control functions within OpenOffice
http://www.openoffice.org/api/docs/comm ... indow.html
https://wiki.openoffice.org/wiki/Docume ... Interfaces
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Post Reply