Create Staroffice Files

StoneKeeper

New Member
hi there,
i want to create starOffice 6.0 filex (especially calc, writer) with a progress application. i am using 8.3a on winnt2000. Can anybody give me an example to do this ? Maybe it is even as simple as the usage of COM Objects for ms excel and word ?

thanks in advance for your help.
regards
 
Answer for interact with OpenOffice

hi,
i got the answer in another forum and the solution works fine with progress 9.1D. It works not with V8.3.

Here is a simple code example:

DO:

DEFINE VARIABLE oService AS COM-HANDLE no-undo.
DEFINE VARIABLE oDesktop AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE oSheet AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE oSheets AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE oCellRange AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE oDocument AS COM-HANDLE no-undo.
DEFINE VARIABLE Args AS RAW NO-UNDO.

CREATE "com.sun.star.ServiceManager" oService.
oDesktop=oService:createinstance("com.sun.star.frame.Desktop").
oDocument=oDesktop:loadComponentFromURL("private:factory/scalc","_blank",0,Args).

oSheets = oDocument:getSheets().
oSheet = oSheets:GetByIndex(0).
oCellRange = oSheet:Getcellrangebyname("a1").
oCellRange:STRING="OpenOffice!".

RELEASE OBJECT oCellRange.
RELEASE OBJECT oSheet.
RELEASE OBJECT oSheets.
RELEASE OBJECT oDocument.
RELEASE OBJECT oDesktop.
release object oService.
MESSAGE "Done!" VIEW-AS ALERT-BOX.
END. :chat:
 
Back
Top