Bug - Document has invalid structure

HTTP Web Server: Lotus Notes Exception - Document has invalid structure

I get this message with following code:

dim doc as notesdocument

dim richTextItem As notesrichtextitem

Set doc = db.createdocument

Set richTextitem = New NotesRichTextItem (doc, “body” )

Call richTextitem.AppendText (“Hello”)

doc.save true, false

BUT: only when running as a scheduled agent on a iSeries AS400 server (Release 6.5.5)

When running the agent in the client it works fine

Workaround:

dim doc as notesdocument

dim richTextItem As notesrichtextitem

Set doc = db.createdocument

'==================

doc.save true, false

'==================

Set richTextitem = New NotesRichTextItem (doc, “body” )

Call richTextitem.AppendText (“Hello”)

doc.save true, false