[Solved] Getting rid of the main window

Discuss the database features

[Solved] Getting rid of the main window

Postby mihmih » Sat Dec 09, 2017 9:04 pm

Hi,

i have a base-file connected to mysql. Mysql is installed on the server on a different computer. And i have a lot of macros. I also have a start screen that starts with the base.

In this case is it possible to get rid of the main base window?
Last edited by RoryOF on Thu Dec 14, 2017 6:43 pm, edited 2 times in total.
Reason: Added green tick [RoryOF, Moderator]
LibreOffice 4.2 on Windows7
mihmih
 
Posts: 103
Joined: Wed Feb 18, 2015 9:21 pm

Re: getting rid of the main window

Postby Villeroy » Sat Dec 09, 2017 9:36 pm

Embedded form documents can be saved as stand-alone documents. Unfortunately, this will disconnect the logical forms. My macro suite "FreeHSQLDB" has a little extra which takes care of this. Simply install the package and run the FreeForms macro. It will prompt you for a target folder. Any hierarchy of embedded form folders will be reflected in the target directory. The stand-alone form documents can be hyperlinked to each other and desktop links will work as usual.
Last edited by Villeroy on Mon May 28, 2018 3:50 pm, edited 1 time in total.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, OpenOffice 4.x & LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26565
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: getting rid of the main window

Postby Villeroy » Sat Dec 09, 2017 9:48 pm

Stand-alone Writer reports: https://forum.openoffice.org/en/forum/v ... 29&t=81229 (simple tables, very slow, not suitable for thousands of records).
Personally, I prefer Calc as reporting engine. Most flexible with a lot of extra features and good enough "pretty printing" capabilities.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, OpenOffice 4.x & LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26565
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Getting rid of the main window

Postby Nocton » Mon Dec 11, 2017 4:27 pm

I use this bit of vbs script to get rid of the main window:
Code: Select all   Expand viewCollapse view
Dim sFileName, sTitle

sFileName = "MyFile.odb"
sTitle = "ERROR"

Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("WScript.Shell")

If Not oFSO.FileExists(sFileName) Then
   oShell.Popup sFileName & "  - file not found", 10, sTitle, vbCritical + vbSystemModal
   Wscript.Quit 1
End If

' run the file with quotes added 1/0 to toggle Base window visible or not
iRC = oShell.Run("""" & sFileName & """", 0, True)

' Return file error level when exiting script
Wscript.Quit iRC
OpenOffice 4.2.0 on Windows 10
Nocton
Volunteer
 
Posts: 495
Joined: Fri Nov 05, 2010 10:27 am
Location: UK

Re: Getting rid of the main window

Postby mihmih » Wed Dec 13, 2017 7:24 pm

Thank you for your answers

Villeroy - where can i find this macro suite?
Does it also solve the problem of macros unrelated to transitions between forms and those that generate relevant reports?

Nocton - vbs in openoffice? I dont understand. Can you say more about your code?
LibreOffice 4.2 on Windows7
mihmih
 
Posts: 103
Joined: Wed Feb 18, 2015 9:21 pm

Re: Getting rid of the main window

Postby Nocton » Wed Dec 13, 2017 7:57 pm

Nocton - vbs in openoffice? I dont understand. Can you say more about your code?

The vbs script runs in Windows to open your application:
1. Copy the code into Notepad and change MyFile.odb to the Base filename you wish to pen.
2. Save with extension .vbs in the folder where your Base file is, e.g. START_myfile.vbs.
3. Now just double-click on START_myfile.vbs to run the script and your application will open with or without the main window according to the setting of 1 or 0 where indicated.
OpenOffice 4.2.0 on Windows 10
Nocton
Volunteer
 
Posts: 495
Joined: Fri Nov 05, 2010 10:27 am
Location: UK

Re: Getting rid of the main window

Postby mihmih » Wed Dec 13, 2017 11:47 pm

thanks for the explanation, but I think I'm too stupid :)

I did what you wrote, but the main window and the start screen are opening to me all the time.

Do I need to change something in the following line?
Code: Select all   Expand viewCollapse view
iRC = oShell.Run("""" & sFileName & """", 0, True)


should I add next zeros between quotes?
LibreOffice 4.2 on Windows7
mihmih
 
Posts: 103
Joined: Wed Feb 18, 2015 9:21 pm

Re: Getting rid of the main window

Postby Nocton » Thu Dec 14, 2017 10:32 am

Nothing should be changed. This script has worked OK on several PCs and running different versions of window.

Maybe I have misunderstood what you mean by the 'main window'. I thought you meant the Base window that gives access to the Tables, Forms, etc.
When I run the script only the window/form opens that I have set as my 'Main Menu' in the 'Open Document' event of the Base application. If that is indeed what you mean, then I have no idea why the script does not work on your system. If not, then please explain further what you would like to happen.

By the way, when opening like this then the user must finish use Ctrl+Q or File/Exit - just closing the window will leave OO still running.
OpenOffice 4.2.0 on Windows 10
Nocton
Volunteer
 
Posts: 495
Joined: Fri Nov 05, 2010 10:27 am
Location: UK

Re: Getting rid of the main window

Postby mihmih » Thu Dec 14, 2017 4:57 pm

I mean exactly what you wrote - the Base window that gives access to the Tables, Forms, etc.

on another computer (where I wanted to apply it) works, thanks a lot!

I have a button to close all, with macro:

Code: Select all   Expand viewCollapse view
Sub close

Dim oDesktop As Object, oDocs As Object
  Dim oDoc As Object, oComponents As Object
 
  oComponents = StarDesktop.getComponents()
  oDocs = oComponents.createEnumeration()
  Do While oDocs.hasMoreElements()
    oDoc = oDocs.nextElement()
    oDoc.dispose()
  Loop
Wait 1000           

Shell("c:\windows\system32\taskkill.exe",2,"/F /iM soffice.bin")
end sub
LibreOffice 4.2 on Windows7
mihmih
 
Posts: 103
Joined: Wed Feb 18, 2015 9:21 pm

Re: [solved]Getting rid of the main window

Postby Nocton » Thu Dec 14, 2017 6:33 pm

Pleased you have got it to work.
And your code to close OO down is a useful addition to this thread.
OpenOffice 4.2.0 on Windows 10
Nocton
Volunteer
 
Posts: 495
Joined: Fri Nov 05, 2010 10:27 am
Location: UK

Re: [Solved] Getting rid of the main window

Postby mihmih » Sat Dec 16, 2017 11:32 am

one more thing...i have a warning, when i open this vbs file:

"dont know who created this file, are you sure you want to open it?"

Can I get rid of this?
LibreOffice 4.2 on Windows7
mihmih
 
Posts: 103
Joined: Wed Feb 18, 2015 9:21 pm

Re: [Solved] Getting rid of the main window

Postby Nocton » Sun Dec 17, 2017 11:51 am

There is a lot on the web about this problem. I have never had it, so cannot comment. Am also now using Windows 10.
OpenOffice 4.2.0 on Windows 10
Nocton
Volunteer
 
Posts: 495
Joined: Fri Nov 05, 2010 10:27 am
Location: UK

Re: [Solved] Getting rid of the main window

Postby mihmih » Sat Dec 15, 2018 11:32 am

one year later....

Code: Select all   Expand viewCollapse view
Dim sFileName, sTitle

sFileName = "MyFile.odb"
sTitle = "ERROR"

Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("WScript.Shell")

If Not oFSO.FileExists(sFileName) Then
   oShell.Popup sFileName & "  - file not found", 10, sTitle, vbCritical + vbSystemModal
   Wscript.Quit 1
End If

' run the file with quotes added 1/0 to toggle Base window visible or not
iRC = oShell.Run("""" & sFileName & """", 0, True)

' Return file error level when exiting script
Wscript.Quit iRC


this script worked very well for wndows7, now I have windows10 and it has stopped working, the main window opens as before. Can anyone know why this code does not work for windows10?
LibreOffice 4.2 on Windows7
mihmih
 
Posts: 103
Joined: Wed Feb 18, 2015 9:21 pm

Re: [Solved] Getting rid of the main window

Postby mihmih » Sat Dec 15, 2018 7:07 pm

meybe it is because i have windows10 x64 and LibreOffice x84.

Is somewhere to download LibreOffice 4.4.X x64?
LibreOffice 4.2 on Windows7
mihmih
 
Posts: 103
Joined: Wed Feb 18, 2015 9:21 pm

Re: [Solved] Getting rid of the main window

Postby Villeroy » Sat Dec 15, 2018 7:18 pm

LibreOffice for Windows 64 started with version 5
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, OpenOffice 4.x & LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26565
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Getting rid of the main window

Postby Zizi64 » Sat Dec 15, 2018 7:20 pm

Here are all of older versions of the LibreOffice:

https://downloadarchive.documentfoundat ... ffice/old/
Tibor Kovacs, Hungary; LO4.4.7, LO6.1.5 on Win7-10 x64Prof.
PortableApps, winPenPack: LO3.3.0-6.2.2; AOO4.1.5
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
 
Posts: 7831
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: [Solved] Getting rid of the main window

Postby Villeroy » Sun Dec 16, 2018 5:21 pm

Stand-alone forms work without any Base window
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, OpenOffice 4.x & LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26565
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Getting rid of the main window

Postby Nocton » Tue Dec 18, 2018 3:43 pm

It works OK for Windows 10 on my PC.
OpenOffice 4.2.0 on Windows 10
Nocton
Volunteer
 
Posts: 495
Joined: Fri Nov 05, 2010 10:27 am
Location: UK


Return to Base

Who is online

Users browsing this forum: UnklDonald418 and 5 guests