Sintaks To Create OpenOffice Writer

frankk

New Member
Hi,

I have some problems, I can't find another sintaks to create openoffice writer from
openedge 10.2a. All samples just like this :
Code:
DEFINE VARIABLE hSM AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE hDesktop AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE hDocument AS COM-HANDLE NO-UNDO.

DEFINE VARIABLE hText AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE hCursor AS COM-HANDLE NO-UNDO.

/* Some methods require an Array parameters for extra arguments. The
only Progress database that translates to Array is RAW. */
DEFINE VARIABLE extraArgs AS RAW NO-UNDO.

CREATE "com.sun.star.ServiceManager" hSM.
hDesktop = hSM:createInstance("com.sun.star.frame.Desktop").
hDocument = hDesktop:loadComponentFromURL("private:factory/swriter", "_blank", 0, extraArgs).
hText = hDocument:getText().
hCursor = hText:createTextCursor().
hText:insertString(hCursor, "This is an example document.", FALSE).

I need more sintaks like how to down 1 line or direct save into file without popup.
Can anybody in this room help me, my boss need some report in openoffice writer.
Tq for your help and attention.

Frankk
 
Last edited by a moderator:
Your best option may be to ask on dedicated Open Office forums for the Visual Basic code syntax for the workings you require. Once you have that hopefully you can derive the Progress code from it.
 
i am working on adding support for generating openoffice's open doucment format files (.odf,.odt,.ods etc.) directly to the free docxfactory project but it will take several month and even upto a year to complete (working weekends on the project).

in the mean time you can download the project and follow the tutorial but openoffice/libreoffice support for ms office files has never been perfect and will probably never be.

another option is to use python that has native uno support (the com equivalent) and shell out to to call the script. i've done that before from progress.

good luck!
 
Last edited:
Back
Top