Can someone tell me why CreateNavigator does nothing?

I found several other posts in older forums for this, but I didn’t find a reason or a solution. Here’s my code:

Set body = mdoc.GetFirstItem("Body")

Call body.Update

'Find first table in Body item

Set rtnav = body.CreateNavigator

body is a notesrichtextitem and is set as expected, rtnav isn’t set at all. The debugger executes the line, but nothing happens. Can anyone tell me why?

I’m pretty sure this code was working before, but the customer has recently upgraded their server to 8.5, so maybe that has something to do with it. ?

I don’t know… I’m baffled. Any ideas?

Subject: Some findings

I was asked to produce reports out of my application. The report is saved in RTItem. Basically the report consists of severeal different tables.In order to save some time I created table template as a special LN document with two fields: TableCode and Body (RTItem used to store template). Then when creating a report I am copiing the template table and populating it with values instead of creating tables from the scratch.

Everything was working fine till I started playing with table profile document (I mean formatting). Then the solution suddenly stopped working and CreateNavigator method did not return nothing.

And now the conclusion: once the RTItem was put into a table in the form design then CreateNavigator stopped working, once it was put directly on the form then it woked fine.

Hopefully this saves some of your time folks.

Subject: CreateNavigator

The Navigator is just a container. It have no properties just methods.

Subject: Ok, if that’s true, then…

Why would my notesrichtexttable values be 0? My test document is simple with one paragraph and one table of 5 columns and 2 rows. I set rtt = rtnav.getelement but the rtt values are 0 for rowcount and columncount; and rowlabels are blank. So, if the navigator is ok, then there must be another reason why the rtt isn’t getting the a handle to the table. Here’s a little more code:

Set body = mdoc.GetFirstItem("Body")

'Find first table in Body item

Set rtnav = body.CreateNavigator

If Not rtnav.FindnthElement(RTELEM_TYPE_TABLE, 2) Then

	Exit Sub

End If



Set rtt = rtnav.GetElement

Any ideas?

Subject: Is there really two tables ? / Was this run on a saved document ?

A couple of of things to check.

First, why are you asking to get the 2nd table in the Body if there’s only one table present ?

Second, bear in mind that unlike normal fields, RichTextFields are not automatically updated between a UIDoc and a NotesDocument as a user edits the fields in the front-end.

What you will see in the NotesDocument (your mdoc) is the contents of the RTF as it existed before the document was opened, and will not include any changes made in the front-end until the two objects are synchronized.

That can be triggered in a couple of ways.

Save the document.

Call body.Update

Both of those actions will update the NotesDocument with any user changes to the UIDoc.

Subject: Answers to your questions…

I’m picking up the second table because the docs being processed are replied emails. The first table is the header info from the sent email, the second table is the actual data I’m after.

There is no uidoc in this case, I’m just working with backend docs.

Since I don’t use the notesrichtexttable variable for anything besides getting the columncount, I just hard coded the number of columns in my code to get it working. It’s not as portable as I’d like it to be, but at least my customer’s happy for now.

I just don’t understand why I can get the fields from the table, but not a handle to the table itself.

Subject: I’d suggest you get a copy of NotesPeek …

…and take a look at how the Body field is constructed in the document. NotesPeek (or scanEZ by Ytria) will show you the actual CD records within the body, so you can see exactly what’s in there.

Just a thought … is this native Rich text, or is the body stored as MIME ?

NotesPeek : http://www.lotus.com/ldd/sandbox.nsf/Threads/2791869F4E1D3FA385256F2C00432973?OpenDocument