Andrew Douglas Pitonyak wrote:
I believe that a text table has different support than a Calc document
yes, the columns are build on tabstops par row (Row.TableColumnSeparators() and this "stops" can been altered

for finding the width of a cel i found somewhere the code below ( maybe in AndrewsBook :-)

  Twidth = oViewCursor.TextTable.width
   TTotalpercent = oViewCursor.TextTable.TableColumnRelativeSum
   startcell = oViewCursor.cell.cellname
   Kindex = asc(left(oViewCursor.cell.cellname,1))-65
   Rindex = int(mid(oViewCursor.cell.cellname,2,2))-1
   CurRow = oViewCursor.texttable.rows.getbyindex(Rindex)
   tabstops = CurRow.TableColumnSeparators()
if kindex = 0 then
             celllW = (twidth * tabstops(Kindex).position/TTotalpercent)
          elseif kindex -1 = ubound(tabstops) then
cellW = twidth - (twidth * tabstops(Kindex-1).position/TTotalpercent) else iFotW = (twidth * tabstops(Kindex).position/TTotalpercent) - (twidth * tabstops(Kindex-1).position/TTotalpercent)
           endif
      end if

hop it helps a bit
Fernand



I only show how to merge and split text table cells in my book (and not in my free macro document). Have you looked at the developer's guide?

Nicole Scholz wrote:
Hi!

I found some examples of merging columns in scalc and I tried to transfer the code into writer. Unfortunately I was not able to get it running.

I created a CellRange of the Table in Writer and then tried to merge the cellRange.

CellRange = xTextTable~xCellRange~getCellRangeByName("A"row":B"row)
CellRange~XMergeable~merge(.true)

When I run the program I get the following error message:
 Object "The NIL object" does not understand message "MERGE"

Do I create the CellRange wrong or call the merge method wrong?

Thanks
Nicole


-------- Original-Nachricht --------
Datum: Sat, 10 May 2008 22:59:24 +0200
Von: "Nicole Scholz" <[EMAIL PROTECTED]>
An: [email protected]
Betreff: [api-dev] merge table columns example

Hi!

I try to merge two columns in one row of a table. I read the developer
guide and I searched the mailing list and so I found out that the XMergeable
Interface is needed and that I have to set the method merge to true.
But I dont know how to do this. How do I say which columns I want to
merge? Can someone give me a short example?

Thanks
Nicole
--
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten Browser-Versionen downloaden: http://www.gmx.net/de/go/browser

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




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

Reply via email to