Find more posts tagged with
Comments
Sort by:
1 - 1 of
11
'Syntax: OpenLayout([LayoutName])
'Test this code from the VBA Immediate window with the following line of code:
'OpenLayout()
'...or...
'OpenLayout("Sermon Layout")
Sub OpenLayout(Optional pLayoutName As String = "Sermon Layout")
'I use latebinding for illustration purposes
Dim Logos As Object
Dim Launcher As Object
On Error Resume Next
'Try to get the running instance of logos first
Set Logos = GetObject(, "LogosBibleSoftware.Application")
'If it is not running, try to execute it using the Logos Launcher
If Err.Number = 429 Then
Set Launcher = CreateObject("LogosBibleSoftware.Launcher")
Launcher.LaunchApplication
'Wait for the App to load
While Logos Is Nothing
Set Logos = Launcher.Application
Wend
End If
On Error GoTo ErrHandler
'Try to load the Layout by name
If Logos.LoadLayout(pLayoutName) = False Then
MsgBox "Can't Load Layout:" & pLayoutName
End If
Exit Sub
ErrHandler:
'Trap unexpected errors
MsgBox Err.Description
Err.Clear
End Sub
If this is what you are looking for I hope it works fine.
If not, explain a bit more with an example what you did previously.