NotesRichTextParagraphStyle and Stable Column Width

I am using the NotesRichTextParagraphStyle to create a table in a Rich Text Item.

I have a total of 9 columns in the table and want to set the table width to 7.5 inches.

The first column I am setting to 1.5 inches and the rest to .75 inches:

1 x 1.5 = 1.5 inches

8 x .75 = 6 inches

Total = 7.5

Here is the code:

For i = 0 To columnTotal - 1

			Redim Preserve styles(i)

			Set styles(i) = s.CreateRichTextParagraphStyle

			styles(i).LeftMargin = 0

			styles(i).FirstLineLeftMargin = 0

    			'Set width of cell...

			If i = 0 Then

				'Set first column to 1 inch...

				styles(i).RightMargin = RULER_ONE_INCH * 1.500

				'Set alignment of cell contents	...	

				styles(i).Alignment = ALIGN_LEFT

			Else

				'Set all other columns...

				styles(i).RightMargin = RULER_ONE_INCH * .7500

				'Set alignment of cell contents	...	

				styles(i).Alignment = ALIGN_CENTER

			End If						

		Next

The column widths, once in the Rich Text field, are set to 1.514 for the first column and .792 to the other columns.

Is there a way to set to the exact width you want?

I see in the debugger that the RighMargin value is set to 2180 as a Long type. Is that some type of conversion? Can I manipulate that?

Thanks!

Dan

Subject: Only Solution: NotesRichTextParagraphStyle and Stable Column Width

The only solution I could come up with was to reduce the .7500 to .6874 and that lined up OK…

It seems you have to try different numbers to get what you need…

Pretty band-aid approach, but no other way as far as I know…

Subject: NotesRichTextParagraphStyle and Stable Column Width

The internal values are in twips (defined in the API as “1 INCH = 72 POINTS, and 1 POINT = 20 TWIPS”, but I just think of them as 1/1440th of an inch), and you are ignoring the width of the borders, which is why your math isn’t adding up. By default, if I recall correctly, the width of the border area is 40 twips, or about 0.28 inches, but it depends on a bunch of issues such as the borders you choose for your cells, the horizontal spacing, etc.