Page 1 of 1

help me to make a macro (if possible)

Posted: Wed Apr 23, 2008 10:25 pm
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?

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

Posted: Wed Apr 23, 2008 11:34 pm
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.

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

Posted: Thu Apr 24, 2008 11:30 am
by tanoatoo
> Tools>Customize...tab:Events
> Save in: <your presentation>

Does it work when loading any .pps, .ppt or .odp file?

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

Posted: Thu Apr 24, 2008 11:39 am
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.

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

Posted: Thu Apr 24, 2008 12:43 pm
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.

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

Posted: Thu Apr 24, 2008 1:19 pm
by tanoatoo
Great thanks, now I will try!!