I’m working on an application where I will have to build a document on the fly so I figured the best way is to do it inside of a rich text field and mark the contents of that field as Pass-Thru HTML so it will render as HTML in the Notes Client. However I’ve run into an issue getting my Rich Text style, specifically the PassThruHTML = True style, to work. I’m also using the NotesRichTextStyle.Bold = True property and it is called just before NotesRichTextStyle.PassThruHTML = True and it works fine, so I don’t understand why the PassThruHTML isn’t working. Are there special conditions for using this property that I didn’t consider? No errors are being presented it’s just the text in the Rich Text field isn’t marked as Pass-Thru HTML. I am able to highlight the text and select the menu option Text\Pass-Thru HTML and it marks the text as Pass-Thru HTML as is expected, I just can’t do it programmatically.
I’ve posted in the ND8 Forum with no responses (heck I even answered a couple of questions while perusing the forum) and I’m at an impasse. Surely this property works and it’s probably me just missing something. I’ve read the help a couple of times and searched all of the forums with no luck.
So, I’ve put together a class (DomRTTable) that builds a table in a rich text field and then there are methods and functions for populating the table cells within the class. Now I’m not entirely sure I wrote this class but it’s commented the way I commented my code before I found LotusScript.doc so I think I developed it, if not I apologize to whomever did and if you let me know I’ll certainly give credit where credit is due. But back to the topic at hand. Now this class is proving to be quite handy with the exception of the issues I’ve described above, but seeing as how I don’t have that much experience dealing with Rich Text I believe I may be in over my head.
But for those interested in messing with the class I’ve posted it in the Downloads section for your computing pleasure and hopefully someone can point me in the right direction for correcting the PassThruHTML issue. I posted the offending code in the “Read More” text.
Public Sub addAllData(valArray As Variant) Dim i As Integer Dim cell As Integer 'Check if a table exists in the field If tableExists = False Then If Me.addTable = False Then Msgbox "Table does not exists and cannot be added!",0,"E R R O R" Exit Sub End If End If For i = Lbound(valArray) To Ubound(valArray) 'Set the text style rtStyle.Bold = Me.boldText rtStyle.PassThruHTML = Me.passthru If i = Lbound(valArray) Then 'Get the first column Call rtNav.FindFirstElement(RTELEM_TYPE_TABLECELL) Call rtItem.AppendStyle(rtStyle) Else 'Get the next column Call rtNav.FindNextElement(RTELEM_TYPE_TABLECELL) End If 'Populate each column with the values from the array Call rtItem.BeginInsert(rtNav) Call rtItem.AppendText(Cstr(valArray(i))) Call rtItem.EndInsert Next End Sub