Hi All,
Could you please help me to short out this problem.
I am trying to get richtext (as same format) data into another document’s richtext field in user interface mode. but i am getting nill. If the receiving field is a text then all the data is appearing without any rich style format say no underline, bold etc.
The code is as follows
Sub Onchange(Source As Field)
'Declare object reference
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim doc1 As NotesDocument
Dim item As NotesItem
Dim RTitem As Variant
Dim Rti As NotesRichTextItem
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
'Declare scalar variable
Dim cLetterCode As String
Dim cFormula As String
Dim cRichText As Variant
'Get value of field
Set uidoc = workspace.CurrentDocument
Set doc=uidoc.Document
Set item=doc.GetFirstItem(“LetterCode”)
cLetterCode = item.Values(0)
Set db = session.CurrentDatabase
cFormula = “Form = ““BodyOfLetter”” & BodyCode = “”” & cLetterCode &“”“”
Set collection = db.Search(cFormula,Nothing,0)
Set doc1=collection.GetFirstDocument
If Not (doc1 Is Nothing) Then
Set item=doc1.GetFirstItem(“BodyAttention”)
doc.QuotBodyAttention = item.Values(0)
Set Rti=doc1.GetFirstItem(“BodyLetter”)
If Not Rti Is Nothing Then
doc.QuotBodyLetter = Rti.GetFormattedText(True,110)
End If
'*** Here i am getting nothing **in ‘Quotbodyletter’ filed of Doc from Doc1
'Set RTitem=doc1.GetFirstItem(“BodyLetter”)
'If Not RTitem Is Nothing Then
'If rtitem.type = RICHTEXT Then
'doc.QuotBodyLetter = RTitem.Values
'End If
'End If
End If
End Sub
Any body can figureout this problem, i would be very gratefull.
Regards
Mani