Re: Set property of selected cell range in a textable in Writer

2015-07-09 Thread Hung Mark
Hi Mathias, I use mouse to select cells, as below. http://i.imgur.com/2H6JFAb.png After running macro. Paragraph property works but the others doesn't. http://i.imgur.com/Tc7utrz.png If I add messages to show the values, I can see that the values changed, but it has no effect on formatting. I

Re: Set property of selected cell range in a textable in Writer

2015-07-08 Thread Hung Mark
Hi Mathias, It doesn't work. 2015-07-08 16:04 GMT+08:00 Mathias Röllig mroellig.n...@gmx.net: Hello Hung! It should be enough: Sub Snippet Dim oCurrentSelection As Variant oCurrentSelection = ThisComponent.getCurrentSelection() oCurrentSelection.setPropertyValue( WritingMode,

Re: Set property of selected cell range in a textable in Writer

2015-07-08 Thread Mathias Röllig
Hello Mark! It works. Maybe you are missing something like oCurrentSelection.setPropertyValue( ParaAdjust, com.sun.star.style.ParagraphAdjust.RIGHT ) Regards, Mathias - To unsubscribe, e-mail:

Re: Set property of selected cell range in a textable in Writer

2015-07-08 Thread Mathias Röllig
Hello Hung! It should be enough: Sub Snippet Dim oCurrentSelection As Variant oCurrentSelection = ThisComponent.getCurrentSelection() oCurrentSelection.setPropertyValue( WritingMode, com.sun.star.text.WritingMode2.TB_RL ) End Sub Regards, Mathias

Re: Set property of selected cell range in a textable in Writer

2015-07-08 Thread Mathias Röllig
Hello Mark! What is your Selection? If you select a complete cell or cellrange it should work. What means it works not? Is there a errror message? If not: Sub CellModifyTest Dim oCurrentSelection As Object Dim i As Integer i = oCurrentSelection.getPropertyValue( WritingMode )

Re: Set property of selected cell range in a textable in Writer

2015-07-08 Thread Andrew Douglas Pitonyak
First, you need to understand what is returned when you get the current selection and then you need to check for it. For example: Nothing selected or multiple text ranges: com.sun.star.text.TextRanges ne or more cells selected in one block: com.sun.star.text.TextTableCursor So, you must

Re: Set property of selected cell range in a textable in Writer

2015-07-08 Thread Hung Mark
Hi, I didn't express very clearly. What I want to do is to set WritingMode property for all the selected cells. I did use MRI to explore APIs, but I was stuck in the middle. To Mathias, When selecting multiple cells, WritingMode of the first cell changed. The remaining cells didn't In contrast,