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

Preventing OpenOffice GUI Dialogs from Popping

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


Joined: 16 Dec 2003
Posts: 3

PostPosted: Mon Jan 12, 2004 5:03 am    Post subject: Preventing OpenOffice GUI Dialogs from Popping Reply with quote

Hi All,

I need to drive OpenOffice.org application from my Java code. For this purpose I open a document using the "hidden" option, so that nothing is visible on screen, and then process the document while it remains hidden.

The problem is that sometimes while opening, saving, printing or performing other operations on the document, a GUI dialog opens asking the user for some sort of confirmation or some message (like unable to open the document).

Since the OpenOffice.org application is being driven by another process (not by the user), I would like to prevent the popping of these dialogs. Specifically, my requirement is:

1. If possible, prevent the dialogs from popping up and instead get some sort of notification that my code can respond to.
2. If the above is not possible, then determine what the dialog is asking the user to do and do that programatically.

Can anybody provide any pointers to achieve 1 & 2 in the most efficient manner?

Regards,
Amit

Here is the existing code snippet:

Code:

// Preparing properties for loading the document
PropertyValue properties[] = new PropertyValue[1];

// Setting the flag for hiding the open document
properties[0] = new PropertyValue();
properties[0].Name = "Hidden";
properties[0].Value = Boolean.TRUE;

// Loading the Wanted Document
xLoadedDocument = xComponentloader.loadComponentFromURL(
    sourceUrl,
    "_blank",
    0,
    properties
);

// Perform other operations on the document
...
Back to top
View user's profile Send private message Yahoo Messenger
Guest






PostPosted: Mon Jan 12, 2004 7:33 am    Post subject: Re: Preventing OpenOffice GUI Dialogs from Popping Reply with quote

Hi Amit,

you can get rid of dialogs popping up by starting OpenOffice with the -invisible or -headless parameters. For a list of all parameters start OpenOffice with

Code:
soffice -help


I'm not aware of the possibility of getting information about the error was other than receiving (and if possible handling) a corresponding exception.

best regards,
Oliver
Back to top
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Mon Jan 12, 2004 10:56 am    Post subject: Reply with quote

Command line arguments document....

http://fr.openoffice.org/Documentation/How-to/Basic/command%20parameters.htm
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
amit_batra
Newbie
Newbie


Joined: 16 Dec 2003
Posts: 3

PostPosted: Tue Jan 13, 2004 7:12 am    Post subject: Headless Option Works Reply with quote

Thanks guys, the "-headless" option seems to supress the dialogs. However I am yet to see my Java code catch an exception in case of a error generated by OpenOffice (for which it would have popped a dialog in the normal course of events). If this happens, that would be the ideal solution.

Thanks again. Smile
Back to top
View user's profile Send private message Yahoo Messenger
Cybb20
Super User
Super User


Joined: 02 Mar 2004
Posts: 1569
Location: Frankfurt, Germany

PostPosted: Fri Oct 29, 2004 2:04 pm    Post subject: Reply with quote

Change it to:
Code:

properties[0].Name = "Hidden";
properties[0].Value = new Boolean(true);


Maybe that's the problem.
Christian
_________________
- Knowledge is Power -
Back to top
View user's profile Send private message Send e-mail
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