"Wrong number of array subscripts" error when using EditDocument method

I need to reload (close and re-open) a document in order to show changes to a rich text field made in the back end.

before I even got to the code to change the rich text field, I wanted to be sure I can close and reopen the doc.

Here is the test code (in an action button):

Sub Click(Source As Button)

Dim ws As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Dim doc As NotesDocument



Set uidoc = ws.CurrentDocument

Set doc = uidoc.Document

doc.SaveOptions = "0"

Call uidoc.Close

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

End Sub

Every time I click the button, I get a “Wrong number of array subscripts” error on the EditDocument line.

Although I would prefer NOT to save the doc before I reload it, I have tried removing the SaveOptions line and saving both the front-end and back-end doc before closing it. I’ve played around with different params in the EditDocument method. All to no avail.

I could swear I’ve used this before, but I can’t understand what is causing this error. There is currently only one field on the form, and there is nothing else in any form events.

Any ideas?

Subject: I’m an idiot

I was using:

Set uidoc = DOC.EditDocument

which SHOULD have been

Set uidoc = WS.EditDocument

Too bad I can’t delete this thread…

Subject: *Nope, all our embarrassing moments are left here for posterity.

Subject: RE: *Nope, all our embarrassing moments are left here for posterity.

And because this is a good thing, Mark, I’m not going to tell you that you can edit your own post and delete or change the content. Wouldn’t help you anyway, as I already copied all you posted to my world master repository and would change this posting to show your code. :stuck_out_tongue: