RichTextItem Problem

Hi,

 I have one document, which contains a edittable Richtext item named "certspdf". I access it following way in Postopen Event.

Dim rtitemDocA As Variant

Set rtitemDocA = docA.getFirstItem( “certspdf” )

And when I try

If (rtitemDocA.Type = RICHTEXT ) Then

Messagebox " Rich Text Item "

End IF

It doesnt pop up message, means its Not RichText Item

can anyone please help.???

Thanks

Abhishek

Subject: Try this

Try this to have Notes show the Type to you:

Set rtitemDocA = docA.getFirstItem(“certspdf”)

Messagebox rtitemDocA.Type

Subject: RE: Try this

It pops messagebox with value "1"but I want to use this method …

rtitem.AppendRTItem(rtitemDocA)

And its saying Object variable not set.

I dont know what to do with this …

My Basic aim is to transfer one Rich Text item Content (Its PDF file) from one document to other document programmatically … Please help.

Code is here .

Dim session As New NotesSession

Dim db As NotesDatabase

Dim collection As NotesDocumentCollection

Set db = session.CurrentDatabase

Dim rtitem As Variant

Dim rtitemDocA As Variant

Dim doc As NotesDocument

Dim docA As NotesDocument

Set doc = Source.Document

Dim grpName As Variant

Dim grpNum As Variant

Dim grpNumStr As String

grpName = doc.GetItemValue(“groupname”)

grpNum = doc.GetItemValue(“gpnum”)

grpNumStr = Cstr(grpNum(0))

Set collection = db.FTSearch(grpNumStr , 1)

Set docA = collection.GetFirstDocument

Set rtitem = doc.getFirstItem( “certspdf_1” )

Messagebox " Abhishek Shah "

Set rtitemDocA = docA.getFirstItem( “certspdf” )

rtitem.AppendRTItem(rtitemDocA)

Abhishek

Subject: Put this code in before you try to get the RTItem

This is in the PostOpen, Right?

If Source.EditMode Then Call Source.Refresh(True)

Subject: RE: Try this

The rich text item does not “contain” the PDF – the attachment is merely anchored (linked to from) there. You need to get the EmbeddedObjects collection of the the RTItem, then cycle through each NotesEmbeddedObject looking for attachments (.Type=1454), then use ExtractFile to put the file into the file system at a known location, the re-atach the file to the RTItem on the destination document.

Subject: RE: Try this

Are you sure about this? I tried with a piece of code to replace a doclink (that point to another document in another db that contains a PDF) in a RichTextItem with the referred PDF.

To copy from a RichText to another I used the

AppendRTItem statement. It seems to work, but in some cases it failed with Notes Databased not yet opened error…