OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

[Solved] can I open Calc such that Calc is not foreground?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
VancouverMike
General User
General User


Joined: 26 Apr 2011
Posts: 12

PostPosted: Thu May 10, 2012 3:49 pm    Post subject: [Solved] can I open Calc such that Calc is not foreground? Reply with quote

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
View user's profile Send private message
fjcc
General User
General User


Joined: 29 Apr 2012
Posts: 5

PostPosted: Thu May 10, 2012 5:48 pm    Post subject: Reply with quote

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
View user's profile Send private message
VancouverMike
General User
General User


Joined: 26 Apr 2011
Posts: 12

PostPosted: Fri May 11, 2012 7:07 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group