Hi Mathias,

> > I just searched the mailing list archive for a method to close an open
> > document. I found something with XStoreable - close and XComponent - 
> > dispose. I tried it, but the whole OOo window closes. But I need the 
> > OOo window opened, and just want to close the document within the 
> > window... How can I do this?
> 
> You should get access to a frame that contains the document.
> If you want to have it simple, use its DispatchProvider API to dispatch
> ".uno:CloseDoc" to the frame. If you prefer handcrafted work:
> 
> (1) First check if other child frames of the Desktop service are open.
> (2) If yes: just close the frame by calling close(True).
> (2) If No: ask controller if it can be closed by calling suspend(True)
> (2) If controller agrees, call setCompontent(0,0) at the frame.

This brought up some thoughts:  In the OOoBean when clearing (there are
OOoBean methods for this), simply the whole Frame is closed.  The
OOoBean can live without a Frame, all you can do than is loading a new
document of course.

But does it probably make sense, keeping the frame?  Any advantages or
disadvantages of either solution?

        Michael



-- 
Michael Hoennig <[EMAIL PROTECTED]>
project lead OpenOffice.org API
http://api.openoffice.org

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to