| View previous topic :: View next topic |
| Author |
Message |
VancouverMike General User

Joined: 26 Apr 2011 Posts: 12
|
Posted: Thu May 10, 2012 3:49 pm Post subject: [Solved] can I open Calc such that Calc is not foreground? |
|
|
how can I open Calc such that Calc is not in the foreground?
i'm controlling OO Calc (3.3) from my application. I'd like to do as i do with Excel...i want to open a document programmatically but have it not become the foreground application. that may sound strange but I'm importing from an OO Calc document and want the OO Calc document there in case the user wishes to review it but want my app in the forground.
if i can't get a window handle for it to minimize it, we could instead hide it altogether but i don't know how to get a window handle from OO Calc so i know which instance i'm sending a message to...
here's what i have been using to open a document:
m_oo_vOpenOfficeWorkbook:=m_oo_vStarDesktop.loadComponentFromURL(convertToURL(sFilename), '_blank', 0, DummyArray);
i hesitated to mention that because i want the entire OO Calc instance to be minimized. i suspect i'd need to talk to one of these instead:
com.sun.star.frame.Desktop
com.sun.star.frame.DispatchHelper
thank you for your help!
with you help, OO support will not disappear from my application.
Last edited by VancouverMike on Fri May 11, 2012 10:48 am; edited 1 time in total |
|
| Back to top |
|
 |
fjcc General User

Joined: 29 Apr 2012 Posts: 5
|
Posted: Thu May 10, 2012 5:48 pm Post subject: |
|
|
I don't know how to put the window in the background. This code minimizes the window, which perhaps will serve your purpose.
| Code: | fileURL = convertToURL("c:\Test.ods")
oDoc = StarDesktop.loadComponentFromURL(fileURL, "_blank", 0, Array())
CompWin = oDoc.CurrentController.Frame.getContainerWindow
CompWin.isMinimized = True |
|
|
| Back to top |
|
 |
VancouverMike General User

Joined: 26 Apr 2011 Posts: 12
|
Posted: Fri May 11, 2012 7:07 am Post subject: |
|
|
| fjcc wrote: | I don't know how to put the window in the background. This code minimizes the window, which perhaps will serve your purpose.
| Code: | fileURL = convertToURL("c:\Test.ods")
oDoc = StarDesktop.loadComponentFromURL(fileURL, "_blank", 0, Array())
CompWin = oDoc.CurrentController.Frame.getContainerWindow
CompWin.isMinimized = True |
|
that worked famously.
THANK YOU! |
|
| Back to top |
|
 |
|