Ines Pfauch wrote:
> Hi
> 
> 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.

Best regards,
Mathias

-- 
Mathias Bauer - OpenOffice.org Application Framework Project Lead
Please reply to the list only, [EMAIL PROTECTED] is a spam sink.


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

Reply via email to