Hello,
I launch a macro from .net application in a writer document to generate a QRCode. My problem is I need to launch document hidden and when document is hidden, macro seems unreach document.
When I start with hidden=false it works fine.
Is there a way to refer thiscomponent to an hidden document ?
Thanks
Start Macro from Hidden writer document
Start Macro from Hidden writer document
OpenOffice 6.2 on Windows 10
Re: Start Macro from Hidden writer document
Have you tried hiding it by positioning it off screen (by setting the window x value to minus the width for example) instead of not visible?
Edit: another alternative would be to hide it behind another open window... perhaps by making it minimum size and the other open window a topmost window. You may be able to use Api calls to change the window style so it doesn't appear in the Windows taskbar.
Edit: another alternative would be to hide it behind another open window... perhaps by making it minimum size and the other open window a topmost window. You may be able to use Api calls to change the window style so it doesn't appear in the Windows taskbar.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: Start Macro from Hidden writer document
It's a good idea. I will look how change position of writer application if it is possible.
OpenOffice 6.2 on Windows 10
Re: Start Macro from Hidden writer document
I have try to change position but I need to open document before change. So I see application then I see my change...
So I need to find and other way. Any idea ?
Cod eto change position if somebody need
So I need to find and other way. Any idea ?
Cod eto change position if somebody need
Code: Select all
Dim vFrame As Object, intXPos As Integer, intYPos As Integer, intHeight As Integer, intWidth As Integer
vFrame = Document.getCurrentController.getFrame()
vWindow = vFrame.getContainerWindow()
intXPos = 6000
intYPos = 6000
intHeight = 1
intWidth = 1
vWindow.setPosSize(intXPos, intYPos, intWidth, intHeight, unoidl.com.sun.star.awt.PosSize.POSSIZE)
OpenOffice 6.2 on Windows 10
Re: Start Macro from Hidden writer document
If it's possible to show and hidden document, it can works but I don't know how show a document open with hidden property
OpenOffice 6.2 on Windows 10
Re: Start Macro from Hidden writer document
Ok i find Document.currentController.Frame.ContainerWindow.setVisible(True)
So I open document hidden, I change position out of screen then I set visible to true.
It works.
At the end I do reverse because if you let with parameters out of screen, when you launch manually open office it keep this parameters.
Thanks
So I open document hidden, I change position out of screen then I set visible to true.
It works.
At the end I do reverse because if you let with parameters out of screen, when you launch manually open office it keep this parameters.
Thanks
OpenOffice 6.2 on Windows 10
Re: Start Macro from Hidden writer document
If the visible/hiding of the document is too obtrusive, you might experiment with making it visible but minimised.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS