RightMargin for text AFTER table in e-mail WRONG

I have created an e-mail body that includes a table. It all looks great and works like it needs to; however, I have one big problem.

In the text that appears AFTER the table, the Right Margin is set to 4" and not the default. Of the table I created, the 1st column is .2", the 2nd column is 4" and the 3rd column is 2.5".

I have tried everything and can’t figure out why it’s doing this. I even reapply a new NotesRichTextParagraphStyle to see if that would “clear” anything, but that doesn’t help.

I can hardcode the RightMargin to another number, like 12" or something, and that works fine; however, that looks great on my big monitor, but won’t on a smaller monitor or a computer with a smaller resolution.

I would like to somehow set the RightMargin back to the default. Another thing is that the line immediately after the table has the right ruler settings. It’s all the text AFTER that line that has a RightMargin of 4" set.

Please help! ARGH!!

Subject: RightMargin for text AFTER table in e-mail WRONG

It sounds like you must be coding this. If so, I am assuming that you are using the Rich-text objects and methods and you are building your table programmatically. It sounds like the table is not getting terminated correctly. It would help us understand if you posted the code.

OTOH, if you are doing this in a client, it sounds like a bug to me.

Subject: RE: RightMargin for text AFTER table in e-mail WRONG

The agent is called from WebQuerySave and here is the code that builds the table…

’ Set up table parameters - column width, etc.

Dim styles(1 To 3) As NotesRichTextParagraphStyle

For i% = 1 To 3 Step 1

	Set styles(i%) = session.CreateRichTextParagraphStyle

	styles(i%).LeftMargin = 0

	styles(i%).FirstLineLeftMargin = 0

	Select Case i%

	Case 1 : styles(i%).RightMargin = RULER_ONE_INCH * 0.3

	Case 2 : styles(i%).RightMargin = RULER_ONE_INCH * 4.0

	Case 3 : styles(i%).RightMargin = RULER_ONE_INCH * 2.5

	End Select

’ styles(i%).RightMargin = RULER_ONE_INCH * 1.5

Next

’ Add table to body - add one more row for column headers

Call msgBody.AppendTable( intNumRows + 1, 3, , RULER_ONE_INCH * 1.2, styles )

’ Now populate table

Dim rtnav As NotesRichTextNavigator

Set rtnav = msgBody.CreateNavigator

Call rtnav.FindFirstElement(RTELEM_TYPE_TABLECELL) 	

’ Write column header and bold it

Dim aryHeader( 1 To 3 )

aryHeader( 1 ) = "Qty"

aryHeader( 2 ) = "Part Number/Nomenclature"

aryHeader( 3 ) = "Reason"



mStyle.Bold = True

Call msgBody.AppendStyle( mStyle )

For i = 1 To 3

	Call msgBody.BeginInsert(rtnav)

	Call msgBody.AppendText( " " & aryHeader( i ) )

	Call msgBody.EndInsert

	Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL)

Next

mStyle.Bold = False

Call msgBody.AppendStyle( mStyle )

’ Now write the rest of the data

For iRow% = 0 To ( intNumRows - 1 ) Step 1

	For iColumn% = 0 To 2 Step 1

		Call msgBody.BeginInsert(rtnav)

		Select Case iColumn%

		Case 0 : Call msgBody.AppendText( " " & aryQty( iRow ) )

		Case 1 : Call msgBody.AppendText( " " & aryParts( iRow ) )

		Case 2 : Call msgBody.AppendText( " " & aryFailures( iRow ) )

		End Select

		Call msgBody.EndInsert

		Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL)

	Next

Next	



Call msgBody.AddNewline( 2 )

’ And continue with remarks

rtpStyle.Alignment = ALIGN_LEFT

Call msgBody.AppendParagraphStyle( rtpStyle )

Call msgBody.AppendText( "REMARKS:  " )

If Not ( itmRemarks Is Nothing ) Then

	Forall x In itmRemarks.values

		msgBody.AppendText( x & Chr$( 13 ) )

	End Forall

End If

It’s the part above where I add the REMARKS to the e-mail that it takes on the 4" right margin. ?!?!