Hi Laurent,

> com.sun.star.util.CloseVetoException

That's okay :), and it was a bug that this exception wasn't thrown
before. (Hmm. Thinking about it, do the other document types behave the
same way?)

The idea is that as long as a view to the document exists, you cannot
close the document - the view will veto is. This is because there's no
possibility to decide that the view was created (with your
'loadComponentFromURL( ..., "_blank", ... )') by the same script which
is now trying to close the document - it could also be a view created by
the user via File|Open.

So, if you want to close the view (I suppose this is what you really
want: get rid of the window displaying the document), then obtain the
CurrentController of the model, and close the frame this controller
lives in.

If this was the last frame, the document should be closed automatically
(if not, it's a bug). If there are more frames, you can iterate through
them (CurrentController will point to the controller in the next frame,
after you closed the previous one). However, this is rather unlikely for
database documents, which to not have the "multiple views per document"
(Window|New window) feature, at least not in the usual sense.

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer         [EMAIL PROTECTED] -
- Sun Microsystems                      http://www.sun.com/staroffice -
- OpenOffice.org Database                   http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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

Reply via email to