Page 1 of 1

[Solved] Silent macro installation

PostPosted: Thu Jan 31, 2008 10:30 am
by keithvassallo
Hello everybody,

I'm doing my thesis, a user migration tool from Windows to Linux. Part of the thesis involves getting a bunch of Office .doc files and converting them to odt. I have the macro which does this, and I even know how to invoke the macro invisibly, so a batch conversion of doc files is possible.

The issue I have is with installing the macro. Is there a way this can be done programmatically without having to instruct the user on how to open openoffice and install the macro manually?

Perhaps I can just copy the macro somewhere or invoke a silent macro installation from within OOO? FYI, the macro is this: http://www.xml.com/pub/a/2006/01/11/fro ... ffice.html

Would appreciate your help!

Re: Silent macro installation

PostPosted: Thu Jan 31, 2008 11:43 am
by probe1
In this very moment I answered your question in oooforum

So, you are asking to install an extension for all users?

see: http://api.openoffice.org/docs/Develope ... ions.xhtml
Quote:
When running unopkg in a windowless mode then the option “--shared” determines if an extension can be used by all users. For example:



[<OfficePath>/program] $ unopkg add --shared my_extension.oxt


Re: Silent macro installation

PostPosted: Thu Jan 31, 2008 12:00 pm
by keithvassallo
probe1 wrote:Does this answer your request?


Bingo!

The unopkg executable offers another way to start the Extension Manager. It supersedes the pkgchk executable which was used in OpenOffice.org 1.1.0 and older versions and which no longer works.

In contrast to the Extension Manager in OpenOffice.org unopkg can also manage shared extensions. For example:

Code: Select all   Expand viewCollapse view
[<OfficePath>/program] $ unopkg add --shared my_extension.oxt


installs my_extension.oxt for all users.

unopkg offers a windowless mode in which all interactions occurs through the console. This is the default. If unopkg is started with the subcommand “gui” then the Extension Manager dialog appears which is exactly the same as the one in OpenOffice.org.


That's exactly what I need to do, thank you!!