Hallo Jörg,

Danke für die Antwort.

Fett formatieren (Nr.2) geht, Viewcursor nicht.

s.u.

Am 26.09.2019 um 12:31 schrieb Jörg Schmidt:
-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Thursday, September 26, 2019 12:14 PM
To: Open Office
Subject: Makro: Zugriff auf Tabelle im Textdokument

Hallo,

ich habe ein Textdokument mit mehreren Tabellen und ich habe bei
Dannenhöfer gelesen.:-)

Ich will

1. dass der Cursor zu einer Zelle springt:

...
myTable=myTables.getByIndex(i)
x=myTable.getCellByPosition(1 , f)
    myViewCursor.gotoRange(x,false)
...

funktioniert nicht.
myTables = ThisComponent.Texttables

habe auch versucht mit

myDoc = thisComponent
   myTables = myDoc.getTextTables


myTable=myTables.getByIndex(i)
mit i=0
x=myTable.getCellByPosition(1, f)
t_cur = x.Text.CreateTextCursor
myViewCursor = ThisComponent.GetCurrentController.ViewCursor
oder

  myViewCursor=myDoc.GetCurrentController.ViewCursor

geht auch nicht


mein Makro sieht im Auszug so aus:


myTables = ThisComponent.Texttables
  myViewCursor=ThisComponent.GetCurrentController.ViewCursor
... i=0..
myTable=myTables.getByIndex(i)

 x=myTable.getCellByPosition(1 , f)
 t_cur=x.text.createTextCursor()
 myViewCursor = ThisComponent.GetCurrentController.ViewCursor
  myViewCursor.gotoRange(t_cur,false)

Also das geiche wie bei dir.


Horst

myViewCursor.gotoRange(t_cur,false)

2. Den Text in der Zelle Fett formatieren

myTables = ThisComponent.Texttables

myTable=myTables.getByIndex(i)
x=myTable.getCellByPosition(1, f)
t_cur = x.Text.CreateTextCursor
t_cur.GotoEnd(True)
t_cur.CharWeight = 150


Gruß
Jörg


---------------------------------------------------------------------
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]

Antwort per Email an