RendertoRTItem and uidoc.Forward question

I am using RendertoRTItem in a Mail Memo form to simulate the uidoc.Forward capability. All seems to go well… except the TO, CC, BCC, Subject fields loose their values after the RendertoRTItem. Everything looks like a UIdoc.Forward, except the actual values of To, CC, etc… are blank. The labels (To, CC, BCC,Subject appear in the correct position) but no values.

If I use uidoc.Forward all the values appear. Is there some field setting on the To, CC fields that control that or am I not doing something correctly.

I need to use the backend capability so uidoc.Forward is not very helpful in this case.

Anybody seen this problem or have any experience with RendertoRTItem ?

Subject: RendertoRTItem and uidoc.Forward question

What “problem”?

RenderToRTitem “Creates a picture of a document and places it into a rich text item you specify.” (from the help). This method “prints” your document but instead of sending the image of your document to a printer it sends it to a rich text field. As it is only an image of the document and not the document itself, it is logical than any field values in your original document will not be copied over to the new document containing the rtf. You will need to pass these manually

eg

Set rtitem = New NotesRichTextItem( ndoc, “Body” )

ndoc.Form = “Memo”

call doc.RenderToRTItem( rtitem )

ndoc.Subject = doc.Subject(0)

ndoc.SendTo = … etc

…

call ndoc.send(false)

Subject: RE: RendertoRTItem and uidoc.Forward question

I was not clear on what the issue is… Let me try again.

When I use RenderToRTItem I am able to create the new document successfully and get the “picture” as you state. The problem I am referring to is the fact that the values for the To/CC/BCC/Subject from the original document do not get copied over as part of the “picture” I get the labels To/CC/BCC/Subject copied and inserted into the Body of the new document, but not the data values. If you use the uidoc.Forward method, you see the entire header section (to/CC/bcc/subject) copied over with all the values and placed within the body of the new document.

Hope this makes sense

Subject: RE: RendertoRTItem and uidoc.Forward question

Hi Karl,

I don’t have a solution for you but I wanted to let you know that I have had a similar problem using RenderToRTItem. In my case, it was just the Subject field which did not appear in the ‘picture’. As with you, the Subject label was there, but the text of the subject was missing.

I had a few quick goes at tracking down the problem but as this was on an internal DB rather than a Customer DB I never spent much time on it. I’ve always assumed it was something to do with Hide Whens on the Memo form in the particular DB but I’ve never verified this.

Emily.

Subject: RE: RendertoRTItem and uidoc.Forward question

I just tried what you describe on my mail file using a standard memo form without any problem. The image of entire memo is copied across to the new memo as you would expect

Dim s As New notessession

Dim ws As New notesuiworkspace

Dim uidoc As notesuidocument

Dim db As NotesDatabase

Dim doc As NotesDocument,ndoc As notesdocument

Dim rtitem As NotesRichTextItem

Set uidoc = ws.CurrentDocument

Set doc = uidoc.Document

Set db = s.CurrentDatabase

Set ndoc = db.CreateDocument

ndoc.Form = "Memo"

Set rtitem = New NotesRichTextItem( ndoc, "Body" )

Call doc.RenderToRTItem(rtitem)

Call ndoc.Save(True,False)

Call ws.EditDocument(True,ndoc)

I assume your problem lies elsewhere - perhaps if you post your code the cause of your problem will be clearer