Hi Everyone - and VilleRoy
First of all, Thanks VilleRoy for all your advice and comments…
I tried saving the form as a Writer document, but the standalone form kept opening first, whereas I wanted it to open dependent on a login (and with the labels displayed in the language of the user).
In the end, I fell back on the solution found in TextureJohn 49147 but using a function derived from another solution by Ratslinger in 66707 .
I created a function to test to see if a form name is open:
Function IsOpenForm(formName as String) as Boolean
Dim oFrames as Object
Dim oForm as Object
Dim sTitle as string
Dim i as integer
IsOpenForm = False
oFrames = ThisComponent.getCurrentController().getFrame().getFrames()
For i = 0 to oFrames.Count - 1
oForm = oFrames.getByIndex(i)
sTitle = oForm.Title
If InStr(sTitle,formName)>0 then
IsOpenForm = True
End if
next i
End Function
This can be used in place of the Continue variable in the solution of 4917, as in:
do while IsOpenForm(“myFormName”)
wait 20
loop
ThisComponent.close(true)
The function is stored in the application’s library, as are all other custom functions and dialogs.
Best wishes,
CB
: