Attaching files with LotusScript and Lotus Notes client 7.x

We are using well known and used workaround to attach document in RT field woth LotusScript. That is the workaround with closing and reopening document in edit mode. Here is part of code:

Call IMiSGetRTItem(SelectedDoc, IMiSrtItem, IMiSAttachField$, “IMiSFile”)

Set IMiSobject = IMiSrtitem.EmbedObject ( EMBED_ATTACHMENT, “”, datoteka$, “IMiSOCR” )

Call SelectedDoc.Save (True, True)

SelectedDoc.SaveOptions = "0"

Call SelectedUIDoc.Close

Call workspace.EditDocument( True, SelectedDoc )

Set SelectedDoc = Nothing

Set SelectedUIDoc = workspace.CurrentDocument  

Set SelectedDoc = SelectedUIDoc.Document

SelectedDoc.SaveOptions = "1"

Call SelectedDoc.Save (True, True)

It works very well with Lotus Notes client 4.x, 5.x, 6.x, but NOT with 7.x.

If we use this code in 7.x, then document is never attached to the selected RT item, but is always attached at the end of the document (under the line). Also hide when formulas are corrupted and there are some issues with save and replication conflicts.

We tried to find the cause and solution in 7.x but no success yet. Has anybody else have similar problems or even has the solution? Should I create PBR?

TIA