| View previous topic :: View next topic |
| Author |
Message |
arvindram Newbie

Joined: 01 Nov 2007 Posts: 3
|
Posted: Thu Nov 01, 2007 12:58 pm Post subject: Help with Table and Bookmark |
|
|
First of all I am a complete newbie as far as OO is concerned. I am pretty sure the answer I am looking for is very very simple, but I can't get it to work.
Secondly I am working with a 4GL tool (not Java or C# or anything fancy like that). This tool has the ability (just like VB), to declare and use Windows API functions and ActiveX COM controls. That's how we have been working (interacting) with MS Word etc.
Now we have a new requirement that this system should work with Open Office. And I am stumped. Searching the internet (including lots of great tips on this forum) I was able to make it work with OO writer for simple bookmarks. My issue is with getting it to work with bookmarks that are specified on a table.
The template has a table (with 7 columns). Each of the columns contains a bookmark that I have to fill programatically. When there is only 1 row of data, it works just fine. But when I have more than 1 row of data, how can I insert a row and also at the same time make the bookmark shift to the new row?
I was able to insert a row using the following:
oWriterApp.getTextTables().getByIndex(1).getRows().insertByIndex(nRowIndex, 1)
But even through the row gets created, I am not able to move the bookmark down to the second row, so that I can set the value for the bookmarks for the 2nd row.
Any hints would be greatly appreciated. |
|
| Back to top |
|
 |
arvindram Newbie

Joined: 01 Nov 2007 Posts: 3
|
Posted: Fri Nov 02, 2007 9:46 am Post subject: Some headway |
|
|
I did the following:
Opened Writer application and inserted a table with 2 columns and 1 row and put a bookmark in each of the columns (bookmarks named: Name_Column, Address_Column). If I now manually insert a new row to this table and hightlight the first row, hit Ctrl + C and hightlight the newly inserted 2nd row and hit Ctrl + V, Writer creates 2 new bookmarks: Name_Column1 and Address_Column1.
From my application I have managed to insert a row in the table using table.getRows().insertByIndex function call. Can anyone help me to copy the first row into the second row? The template will have only 1 row (with the bookmarks). When I open the template I will know how many rows will need to be created in the finished document. So I will be able to call the insertByIndex function repeatedly to insert how many ever rows I need. But I need help in copying the first row to the other rows. Any help will be greatly appreciated.
Thanks in advance. |
|
| Back to top |
|
 |
arvindram Newbie

Joined: 01 Nov 2007 Posts: 3
|
Posted: Tue Nov 13, 2007 4:07 am Post subject: Help? |
|
|
| Any sample code or suggestions for table and bookmarks? |
|
| Back to top |
|
 |
|