Render to Richtext Question

Hi,

Is it possible to render a document to a RTF field(RendertoRTF method), if the document already has a RT Item in it?

Regards

Bafie

Subject: Render to Richtext Question

Absolute. I do it all the time.

Subject: RE: Render to Richtext Question

Hmm?

Because when I do it, the new richtext field is always empty.

See code:

Dim ws As New NotesUIWorkspace

Dim session As New NotesSession

Dim db As NotesDatabase

Dim uidoc As NotesUIDocument

Dim thisdoc As NotesDocument

Dim bval As Variant 





'This sets the db to the current db

Set db = session.CurrentDatabase

'This captures the current document

Set uidoc = ws.CurrentDocument

'This takes it to the backend

Set thisdoc = uidoc.Document

Dim tempDoc As New NotesDocument(thisdoc.ParentDatabase)

tempdoc.form="Print"

Dim rtitem As New NotesRichTextItem(tempDoc, "Print")"Field name is print

			

'** render the document to a rich text 

'** for that rich text field

bval=thisdoc.RenderToRTItem(rtitem) 



Call tempDoc.Save(True, True)

Set uidoc = ws.EditDocument(True,tempdoc,True)

Subject: RE: Render to Richtext Question

No hide-flags or hide-whens on that rich text?

Subject: RE: Render to Richtext Question

Hi Ben,

No, no hide-when flags etc on the Print Form.

However, there are a couple of hide when fields on the original document. But these are more “formatting” fields…

Subject: RE: Render to Richtext Question

Aha! Those hide-whens on the original form can get carried along with the rich text. Look at the formula and see if you can make it False on the Print form (by copying over or setting field values).

Subject: RE: Render to Richtext Question

Hi Ben,

Good idea!

If you do a copyallitems, does it loose the hide-when property or do I need to change that somehow?

Subject: RE: Render to Richtext Question

It won’t lose the hide-when properties. That could work.

Subject: RE: Render to Richtext Question

Hi Ben,

I copied the items and used another form where the fields are not hidden. It works this way. Well, sort of… I loose all the formatting in the RT Field of the original doc. Is there anyway to retain the formatting?

Regards,

Bafie

Subject: RE: Render to Richtext Question

Has the UI document been saved?

Subject: RE: Render to Richtext Question

Hi Stan,

Yes, the UIdoc has been saved.

This is driving me nuts!

Should I be looking at doing something different?

Thanks

Bafie