help me to make a macro (if possible)

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
tanoatoo
Posts: 11
Joined: Mon Apr 21, 2008 5:46 pm

help me to make a macro (if possible)

Post by tanoatoo »

Hello,
I use openoffice impress to reproduce power point presentations.
I see that openoffice has the strange issue to insert a pause
of ten seconds when the slideshows finish and has to restart,
(a bug?), and I would like to know how to set up a macro to
delete this pause.
I found a property on openoffice docs at:

http://wiki.services.openoffice.org/wik ... sentations

named Pause(long), described as:

the amount of time that a blank screen is displayed at the end of the presentation

and I would like to set up it as zero always, to workaround this
issue.
How to do?
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: help me to make a macro (if possible)

Post by Villeroy »

Tools>Macros>Organize...<your presentation>, any_library, any_module.

Code: Select all

Sub on_Open_Create()
ThisComponent.Presentation.Pause = 0
End Sub
Tools>Customize...tab:Events
Save in: <your presentation>
<Open Document> ,[Macro...] <your presentation>, any_library, any_module, on_Open_Create
<Create Document> ,[Macro...] <your presentation>, any_library, any_module, on_Open_Create
The latter event is triggered when this document gets loaded as template.
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
tanoatoo
Posts: 11
Joined: Mon Apr 21, 2008 5:46 pm

Re: help me to make a macro (if possible)

Post by tanoatoo »

> Tools>Customize...tab:Events
> Save in: <your presentation>

Does it work when loading any .pps, .ppt or .odp file?
tanoatoo
Posts: 11
Joined: Mon Apr 21, 2008 5:46 pm

Re: help me to make a macro (if possible)

Post by tanoatoo »

Excuse me, perhaps I need to clarify.
I do not have Oo at hand, however I would like to know if this solution has to be
attached to every file or if it is an application setup, so that it works
for all presentations loaded (and not modified) in Oo.org.
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: help me to make a macro (if possible)

Post by Villeroy »

I suggest to store the macro within your (default-) template(s) where this setting is required. So it works on every system where the presentation is shown.
You can have the same for every presentation you open on this system when you install the macro in container "My Macros" together with the following switch:

Code: Select all

Sub on_Document_Open_Create()
   If ThisComponent.supportsService("com.sun.star.presentation.PresentationDocument") then

thisComponent.Presentation.Pause = 0
REM same for other components. Add your stuff here:

   ElseIf ThisComponent.supportsService("com.sun.star.sheet.SpreadsheetDocument")then
      REM GlobalScope.BasicLibraries.LoadLibrary("Calc")
   elseif ThisComponent.supportsService("com.sun.star.text.TextDocument")then
      REM GlobalScope.BasicLibraries.LoadLibrary("Writer")
   elseif ThisComponent.supportsService("com.sun.star.drawing.DrawingDocument") then
   endif
End Sub 
Menu:Tools>Customize... Tab:Events
Save in: "OpenOffice.org"
Events: <Create Document> and <Open Document>

Now this is called for all documents and you may add your own procedure calls to the switch.
In this very simple case it should not matter when you change the setting twice, on application level and from the template/document again.
Last edited by Villeroy on Thu Apr 24, 2008 1:25 pm, edited 1 time in total.
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
tanoatoo
Posts: 11
Joined: Mon Apr 21, 2008 5:46 pm

Re: help me to make a macro (if possible)

Post by tanoatoo »

Great thanks, now I will try!!
Post Reply