Craig Johnson wrote:
denis wrote:
Hi,

Craig Johnson wrote:
I have a logging routine that writes output to a file and I would like to be able to have the output also appear on the screen as the macro is running. I do not want the output to appear in popup windows as the macro is being executed with 'soffice -headless'.

Is it possible to print to STDOUT (and/or STDERR) from a Staroffice basic macro?

you can use com.sun.star.logging.ConsoleHandler.

Something like this:

    dim msg as new com.sun.star.logging.LogRecord
    msg.Message = "Hello"
    msg.Level = com.sun.star.logging.LogLevel.ALL

    dim obj as object
    obj = createUnoService("com.sun.star.logging.ConsoleHandler")
    obj.initialize(Array())
    obj.Level = com.sun.star.logging.LogLevel.ALL
    obj.publish(msg)

More info:
http://api.openoffice.org/docs/common/ref/com/sun/star/logging/module-ix.html

Regards,
Denis

Hi Denis,

Unfortunately this does not seem to work.

This didn't work when run with Openoffice 2.4.1 on MacOS 10.4.11

This *did* work when run with Staroffice 8.9 on Solaris 5.10


I put the code in a document as a 'test' subroutine then invoked with

 soffice macro://my_doc/my_lib.my_mod.test file:///Users/craigj/my_doc.ods

but did not see the 'Hello' message on the screen.

Craig





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

Reply via email to