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. ?!?!