OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Cell Alignment and Cell Color

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
Anisha
Newbie
Newbie


Joined: 06 Dec 2004
Posts: 2

PostPosted: Thu Dec 09, 2004 10:56 pm    Post subject: Cell Alignment and Cell Color Reply with quote

Hi ..

I am writing to a word document using OpenOffice.
I would like to know how to align your text to the center/left of the cell in a table.
I tried the following:
xCell = xCellRange.getCellByPosition(i,j);
XPropertySet xCellProps = (XPropertySet)UnoRuntime.queryInterface(
XPropertySet.class, xCell);
xCellProps.setPropertyValue("HoriJustify",com.sun.star.table.CellHoriJustify.CENTER);

It is throwing UnknownPropertyException.
Can someone tell me how to align the text.

Also I need to set the color as a String . OpenOffice accepts Color in RGB format.
I need to know how to convert Color to RGB .. i.e. from "red" to its RGB value.

Appreciate your help.
Thanks in advance.

Anisha.
Back to top
View user's profile Send private message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Fri Dec 10, 2004 7:28 am    Post subject: Reply with quote

See....
http://www.oooforum.org/forum/viewtopic.php?p=53235#53235
for alignment or justify on a cell.

Get the Text of the cell.
Adjust the Paragraph properties on the text of the cell.


For cell color....
http://www.oooforum.org/forum/viewtopic.php?p=23951#23951
http://www.oooforum.org/forum/viewtopic.php?p=22938#22938
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group