Target frame is ancestor of script object

Hello List

I did search this list but I couldn’t find a answer so I hope this list can help me out.

I do get this ‘Target frame is ancestor of script object’ message with the following code

rti.update

call uidocDR.Close ( true )

wks.SetTargetFrame ( “REP” )

set uidocDR = wks.EditDocument ( True, docDR,True ) <-= at this line

I have a frame set with four frames.

In one I have a profile document.

In another frame, the code do load the form “DR” ( SaveOptions =“0” )

I create this DR form with

if ( uidocDR is Nothing ) then

…wks.SetTargetFrame ( “REP” )

…set uidocDR = wks.ComposeDocument ( “”,“”, “DR” )

…set docDR = uiDocDr.Document

end if

If I use

set uidocDR = wks.EditDocument ( False, docDR,False,False )

then I dont see the message but the whole frame closes

I am using a rtf field in the DR form and build this field dependend on the profile form data and some other data.

Because of the rtf field I have to close and reopen the document.

How can I do that in the specified frame?

Thanks

René

Subject: Target frame is ancestor of script object

Check out the Help on EditDocument - set the return UIDOC to false…to avoid the error.

This method raises the error lsERR_LSXU13_ANCESTOR_TARGET_FRAME (4426) if it attempts to return a NotesUIDocument object for a target frame that is the ancestor of the frame containing the code. You can suppress returning the object by specifying returnNotesUIDocument as False. The document opens in the target frame but you do not have access to its NotesUIDocument object. Calling this method as a subroutine does not suppress returning the object; you must specify returnNotesUIDocument as False.