Bug 99955 - Macro to open form on document opens form, but invisibly.
Summary: Macro to open form on document opens form, but invisibly.
Status: RESOLVED DUPLICATE of bug 95191
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
5.1.2.2 release
Hardware: x86-64 (AMD64) macOS (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2016-05-19 20:37 UTC by Basil
Modified: 2016-05-20 07:35 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Basil 2016-05-19 20:37:20 UTC
This is the macro I use to open the form:

Sub oDoc_1( )
Dim ObjTypeWhat
Dim ObjName As String
ObjTypeWhat = com.sun.star.sdb.application.DatabaseObject.FORM
ObjName = "My.Home.Form" 'The name of the form you want to open at Base start-up, this needs to exist.
If ThisDatabaseDocument.FormDocuments.hasbyname(ObjName) Then 'Check the form exists
ThisDataBaseDocument.CurrentController.Connect() 'If the form exists connect to the database
ThisDatabaseDocument.CurrentController.loadComponent(ObjTypeWhat, ObjName, FALSE) 'Open the form
Else
MsgBox "This is embarrassing, sorry, can't find the requested form to open!"+chr(10)+"Form Name = " & ObjName + chr(10)+"Check the details." , 48, "DS4A SBM encountered a problem!"
End if
End Sub

It works properly on Linux, but on OSX, the form opens, but displays invisibly.  It sometimes flashes visible on closing LO, which isn't useful.
Comment 1 Alex Thurgood 2016-05-20 07:34:55 UTC

*** This bug has been marked as a duplicate of bug 95191 ***