I have the following code:
Set CJdoc = CJCollection.getFirstDocument
Do Until CJdoc Is Nothing
Set rtitem = CJdoc.GetFirstItem("GLBody")
If (rtitem.Type = RichText) Then
If PlainText = "" Then
PlainText = "The following text was copied from " & CJdoc.Type(0) & " Log - " & CJdoc.Wed(0) & ": " & Chr(13) & rtitem.GetFormattedText(False,0)
Else
PlainText = PlainText & Chr(13) & Chr(13) & "The following text was copied from " & CJdoc.Type(0) & " Jeers Log - " & CJdoc.Wed(0) & ": " & Chr(13) & rtitem.GetFormattedText(False,0)
End If
Else
Set rtitem = CJdoc.GetFirstItem("Body")
If (rtitem.Type = RICHTEXT) Then
If PlainText = "" Then
PlainText = "The following text was copied from " & CJdoc.Type(0) & " Log - " & CJdoc.Wed(0) & ": " & Chr(13) & rtitem.GetFormattedText(False,0)
Else
PlainText = PlainText & Chr(13) & Chr(13) & "The following text was copied from " & CJdoc.Type(0) & " Log - " & CJdoc.Wed(0) & ": " & Chr(13) & rtitem.GetFormattedText(False,0)
End If
Else
If PlainText = "" Then
PlainText = "There was no information in the Cheers & Jeers document dated " & CJdoc.Wed(0) & "."
Else
PlainText = Plaintext & Chr(13) & Chr(13) & "There was no information in the Cheers & Jeers document dated " & CJdoc.Wed(0) & "."
End If
End If
End If
Set CJdoc = cjcollection.GetNextDocument(CJdoc)
Loop
If glBody has data entered in the field, the code works…
But if not… I get “Object variable not set” on this line of code:
If (rtitem.Type = RichText) Then
I have the field GLBody field on the form. A document is saved using this form. How come in the dcoument properties, I don’t see a GLBody field that = “”