Ask Your Question
0

Property of ThisComponent does not appear with impress macro when Running on Raspberry Pi

asked 2014-01-15 18:02:36 +0100

steak1986 gravatar image

updated 2015-10-04 21:56:54 +0100

Alex Kemp gravatar image

I am using libre office on 3.6, on a raspberry pi. I have installed libre office with no problems. On past versions i would use a macro to stop the powerpoint presentation from pausing at the end of a slideshow, using this article https://issues.apache.org/ooo/show_bu... . That worked flawlessly for a little while, until i built a new device, and now when i try and apply this macro i get the following error "BASIC runtime error. Property or method not found: Presentation" on line 12, "Presentation = Doc.Presentation". Unfortunately i dont know scripting well enough to know what is going on. Does anyone have any idea for me to look at?

REM  *****  BASIC  *****
REM Set presentation variables for all presentations
REM See also the OOo Developer's Guide:
http://wiki.services.openoffice.org/w/images/9/93/DevelopersGuide_OOo3.1.0_09DrawingDocuments.odt

Sub Main

Dim Doc As Object
Dim Presentation As Object

Doc = ThisComponent
Presentation = Doc.Presentation

REM Uncomment the line below to make all presentations loop endlessly:
REM Presentation.IsEndless(True)
edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2015-07-21 10:11:54 +0100

karolus gravatar image

try to attach to event:
→Tools→Customize→Events→Document loading finished instead ....Open Document

edit flag offensive delete link more
0

answered 2015-07-21 09:05:46 +0100

doug gravatar image

The error is that the object Doc is being reported as not having the property Presentation. When properly created, the object of course does have that property. You can see via this command: MsgBox Doc.dbg_properties. In a long list in the pop-up box, you will see the SbxOBJECT Presentation which means the property Presentation returns an object which also has properties and methods itself (such as IsEndless).

So why is/was this problem happening? Based on your question, and my own experience, I would guess that your macro is getting ahead in timing of the operation of LibreOffice, and so it is retrieving this variable before it is defined globally or before it has the expected properties and methods. If you do the command noted above, it may report something like 'Introspection Not Available'. The way to deal with this kind of problem is to test for the availability of the property and Wait 10. You could just Wait an arbitrary length of time (like Wait 3000) or you could institute a loop test:

Do Until InStr(ThisComponent.dbg_properties, "Presentation") > 0
  Wait 10
Loop

When the property appears, it will proceed. As a backup, might want to build a counter into that to make sure it stops eventually if the property never appears.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2014-01-15 18:02:36 +0100

Seen: 691 times

Last updated: Jul 21 '15