[Solved] Writer: change font and center text in Cells table

Java, C++, C#, Delphi, ??? - Using the UNO bridges

[Solved] Writer: change font and center text in Cells table

Postby jfpetit » Tue Dec 04, 2012 4:11 pm

I create an OpenOffice document with Delphi. I insert a table in my document.
My question is : How to change font and to center text into the all the cells of the table?
Thanks for help
Last edited by jfpetit on Wed Dec 05, 2012 8:00 pm, edited 3 times in total.
OpenOffice 3.4.1
Windows XP
jfpetit
 
Posts: 13
Joined: Tue Dec 04, 2012 10:48 am

Re: OOWriter with Delphi How to center text in Cells table

Postby FJCC » Tue Dec 04, 2012 7:43 pm

If you want to change only some cells, something like this (in OO Basic) should work.
Code: Select all   Expand viewCollapse view
oTxtTables = ThisComponent.getTextTables()
oTable = oTxtTables.getByIndex(0)
oCurs = oTable.createCursorByCellName("A1")
oCurs.ParaAdjust = com.sun.star.style.ParagraphAdjust.CENTER
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 7680
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: OOWriter with Delphi How to center text in Cells table

Postby jfpetit » Wed Dec 05, 2012 9:34 am

Thanks for your answer.
Is it possible to change the font and to center text of all the cells of the table?
Thanks for help
OpenOffice 3.4.1
Windows XP
jfpetit
 
Posts: 13
Joined: Tue Dec 04, 2012 10:48 am

Re: OOWriter How to change font and center text in Cells tab

Postby FJCC » Wed Dec 05, 2012 3:41 pm

Code: Select all   Expand viewCollapse view
oTxtTables = ThisComponent.getTextTables()
oTable = oTxtTables.getByIndex(0)
oCurs = oTable.createCursorByCellName("A1")
oCurs.gotoStart(False)
oCurs.gotoEnd(True)
oCurs.ParaAdjust = com.sun.star.style.ParagraphAdjust.CENTER
oCurs.CharFontName = "Arial"
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 7680
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: OOWriter How to change font and center text in Cells tab

Postby jfpetit » Wed Dec 05, 2012 7:59 pm

It works.
Thanks
OpenOffice 3.4.1
Windows XP
jfpetit
 
Posts: 13
Joined: Tue Dec 04, 2012 10:48 am


Return to External Programs

Who is online

Users browsing this forum: No registered users and 2 guests