Rich Text 101 - Hide-when formulas
Tue 1 Jun 2004, 08:40 AMTweet
by Ben Langhinrichs
Copyright © 2004 Genii Software Ltd.
What has been said:
164.1. Bob Reichlen (11/12/2004 11:32 AM)
I have many douments (thousands) that were created with a form that originally contained only one rich text field - for attachments. This RT field had hide-when formulas on it. Subsequently we have redesigned the form, eliminated the hide-when formulas and added three new rich text fields for attachments.
The problem now is that the original RT field and one other don't show up when the form in being displayed on Notes (in display or edit mode). I have 3.30 copy of Midas and I'm running on Domino Version 6.03.
I tried using a code example from the Midas Help database to clear the hide-when formulas, but it isn't working. I've included the sample code below. I can see the attachments when I view the docs on the Web. And I know how to cean up the docs one at a time manually. I Save the attachment to my local system while viewing from the Web. I then use a Notes formula to remove the bad fields from a document. Then I open the doc in Notes and re-attach the attachment. But this is certainly impractical for the number of docs I need to fix.
The code I tried is as follows:
' *** Clear all hide attributes from rich text fields in selected documents, ' *** including hide-when formulas, hide from notes/web and hide when
' *** reading/editing/copying
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim rtitem As New GeniiRTItem
Dim rtchunk As GeniiRTChunk
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
Set doc = collection.GetFirstDocument
While Not (doc Is Nothing)
Call rtitem.Connect(db.Server, db.FilePath, doc.NoteID, "Body")
If rtitem.IsConnected Then
Set rtchunk = rtitem.DefineChunk("Everything")
' *** Clear all the hide-when attribute flags
rtchunk.ParagraphStyle = |-HIDE_WEB -HIDE_PREVIEW_READ -HIDE_EDIT
-HIDE_PREVIEW_EDIT -HIDE_PRINT -HIDE_COPY -HIDE_EMBEDDED -HIDE_MOBILE|
' *** Clear all the hide-when formulas
rtchunk.HideFormula = ""
Set doc = collection.GetNextDocument(doc)
164.2. Khader (07/14/2005 04:47 AM)
Notes crashes, quite often, what wil be the cause ?
and how to solve this problem
164.3. Ben Langhinrichs (07/14/2005 04:55 AM)
I'm afraid that is too general a question. Does the crash have to do with hide-when formulas?
164.4. Ahamed (11/09/2009 01:12 PM)
Hi, Your fix to the rich-text hide-when issue (by adding a blank space) helped me. Thank you!
164.5. Joel (02/07/2012 15:35)
Thanks for this. As a newcomer to the world of Lotus Notes this solved my problem without needing to go to a huge level of complexity.