Link to home
Start Free TrialLog in
Avatar of Haddadm
Haddadm

asked on

Rich Text empty

How do you test if a rich Text field is empty ?
Avatar of Haddadm
Haddadm

ASKER

I have a function that test the selection unselection of a rich text field .
If there is an error, th explanation is that the rich text field is empty.

but this function doesn't work if a field tested is in a table.
Try the HasEmbedded property of the document class.
Avatar of Haddadm

ASKER

I want to test the field before a save was done
u cant do that!:)
rtf's are only created on the form upon saving. u can probably test for text existence in the rtf.
Avatar of Haddadm

ASKER

Adjusted points to 100
RTF's are created only when the document is saved. May be you can try :

uidoc.fieldgettext("Body").

Where the Body is the name of the RichText field.
But pls note, this will check only for text and not attachment or objects.

Avatar of Haddadm

ASKER

It's not what I'm looking for.
I want to Test : Text, Attachmment, Link or .... in the field.

Look, these excerpts are from the Notes help file:
"Rich text fields
Rich text fields cannot be evaluated for content. For example, if BodyText is a rich text field, you cannot display its contents with @Prompt, and you cannot convert it to plain text by specifying @Text(BodyText). However, you can access the attributes of the field. The following formula tests for the availability of a rich text field.
@Prompt([OK]; "Is BodyText Available"; @If(@IsAvailable(BodyText); "Yes"; "No"))"
"Updates to rich text items accessed through NotesUIDocument are not immediately incorporated into the NotesUIDocument object. You must close and open the document to see the updates."
Its the way RTFs are. U can actually test for text in the RTF ONLY (u cant test for attachments or links prior to saving) because its considered as a property of the field. u will have to think of another way to set ur application.
Good Luck
Avatar of Haddadm

ASKER

Adjusted points to 200
I suggest u adjust them to 1000
Did u realize yet that its not possible?
Visit this website:
http://www.lotus.com/partners/partcat.nsf/18ef9bc5a41c1e6b8525636300779478/ddc93e3aed154a878525667b00463bae?opendocument
This is a product from Genii soft, that has some classes to manipulate RTFs. I think it will help u. This is their website:
http://members.aol.com/GeniiSoft
Avatar of Haddadm

ASKER

I know that it's possible because I have a function that evaluate a RTF Field.

I think u r a genius, coz u just proved the creators of Lotus Notes wrong.  Contact Lotus and tell them that u have a function that do that...and register this as an invention.  I rest my case!
I would like to know that function too. I have 985 points to spent. Post your solution and by God, if it works, I'll give them to you valuated with "A". That makes almost 4000 points in one shot!!!!!! The only condition: No 3rd party products have to be involved.


You can try this to validate if the uidocument has a file
before saving.
But if you checking more than one field it ain't gonna work
Set doc = uidoc.Document
     filecount = 0
     Stop
     Forall field In doc.items
          If field.name = "$FILE" Then
               filecount = filecount +1
          End If
     End Forall
     Msgbox Cstr(Filecount)
ASKER CERTIFIED SOLUTION
Avatar of ghassan99
ghassan99

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial