Hi Klaus,
I have recently created some code that sets the tab position in a table cell to be at the right edge of that cell. This is a slightly different use case, as I cannot use a paragraph format for that ( the size of the cell might change and at that point the tab position will be wrong again ), but the basic method should also work for your code.
What I found is that changing the existing tab properties in a paragraph (or para format) does not work. You have to use GetProps( ), then change the tab positions object (change the position and/or add or delete tabs), then use SetProps( ) to make the tabs take effect. The SetProps( ) probably does a bunch of stuff, including reordering the tabs in the array according to their relative positions.
Here is the part of my code you should be able to use (I am only changing a single tab position, so you may need to adapt the code there to make it work for you). I first calculate the tab position in metrics by retrieving the cell width.
var oaProps = oPgf.GetProps( ); |
var i = GetPropIndex( oaProps, Constants.FP_Tabs ); | ||||
oaProps[i].propVal.tsval[0].x = iTabPosInMetric; | ||||
oPgf.SetProps( oaProps ); |
Good luck.