Need working exampl for InsertSheetfromFile (or alternative)

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
smguenther
Posts: 10
Joined: Fri Jan 09, 2009 9:22 am
Location: Karlsruhe - Germany

Need working exampl for InsertSheetfromFile (or alternative)

Post by smguenther »

Hi,

I need to create a calc file (with will serve as a source for a mail merge) from a csv file.

We have a batch file which should start scalc.exe with an empty calc file that contains a macro which imports the csv file and saves is under a predefined name.
After this the batch file will start writer to create the mail merge. The batch file will run a couple of times every day and it will start automatically.

I have recorded a macro in calc for the necessary steps and this macro contains the following lines:

rem ----------------------------------------------------------------------
rem dispatcher.executeDispatch(document, ".uno:InsertSheetFromFile", "", 0, Array())

Well, this doesn't help much, since it is only a comment, with no file name or any options.

There are a number of articles/posts about InsertSheetFromFile but no working examples.

Does someone sucessfully use InsertSheetFromFile or has a suggestions on how to solve this little problem?

The system we are working with is OOo 3.0 on Win XP.

Thanks for any help or hints.

Stefan
OOo 3.0.X on Ubuntu 8.x + Windows XP
Post Reply