Unable to find Document window

When I use NotesUIWorkspace.EditDocument I get the following error "Unable to find Document window"I am using NotesUIWorkspace.SetTargetFrame to specify which frame in the frameset I want to open my document.

Here is the code:

Dim session As New NotesSession

Dim db As NotesDatabase

Dim ws As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Dim doc As NotesDocument



Set ws = New NotesUIWorkspace

Set db = Session.CurrentDatabase

Set uidoc = ws.CurrentDocument



Set doc = New NotesDocument(db)

doc.form = "MyForm"



Call ws.SetTargetFrame("RightPane")



Set uidoc = ws.EditDocument(True, doc, False)

If I change the code to

Call ws.SetTargetFrame(“”)

I do not get the error, but the document opens in a new window. I have checked the Launch Properties on the Form properties and this is set to open in “RightPane”

Using formula language it works fine.

How to I use LotusScript to open a doc in a designated Frame and not in a new window?

Many thanks

Adam.

Subject: Unable to find Document window

Hi,

if you intend to replace the content of the current frame, copy your code into an agent and run this agent in a Button.

This runs only with opened documents.

I don´t have any solution to replace the frame content where a view or a page is opened.

Subject: Re: Unable to find Document window - possible solution

I had this error … and finally discovered that the Form name that I was specifying had a typo in. So what the error msg is trying to tell you is that it can’t find the Form!Don’t you just love some Lotus error messages.

Subject: RE: Re: Unable to find Document window - possible solution

I create a document with an alias name of a form. It worked fine until we changed to 8.5.2. One User was not able to edit the new document. When i changed the form name to the “normal” form name instead of the alias name, it worked again.

Hth

Sebasian