From a view, which is embedded view in a form, I start a Lotus Script by clicking an action button, which is stored in a Script Libery.
The script creates a new document in the back end based on values of the selected documents. Finally I closed the document from which the operation is started and after this the new document is opened.
This code works without problems using Notes Clients 6.5x. When I am working on the same with Client 7.0.1, the client crashes with an red window and Windows XP is shutting down with an stop error.
Has someone an idea or some information about this terrible behaviour.
Here is my code:
Dim ws As New Notesuiworkspace
Dim thisdb As NotesDatabase
Dim sview As Notesuiview
Dim selection As NotesDocumentCollection
Dim doc As NotesDocument
Dim wdoc As NotesDocument
Dim sdoc As NotesDocument
Dim sIDs() As String
Set sview=ws.CurrentView ‘embedded view
Set selection=sview.Documents
If selection.Count=0 Then
Exit Sub
End If
Set thisdb=sview.View.Parent
Set doc=ws.CurrentDocument.Document ‘Backend Instance of starting document
Set wdoc=New NotesDocument(thisdb) ‘New document to process
wdoc.Form=“FormAlias”
wdoc.Field1=“Field1_Value”
i%=0
Set sdoc=selection.GetFirstDocument
Do Until sdoc Is Nothing
Redim Preserve sIDs(i%)
sIDs(i%)=sdoc.UniversalID
i%=i%+1
Set sdoc=selection.GetNextDocument(sdoc)
Loop
wdoc.SampleDocIDs=sIDs
‘Closing the the starting front end doc and opening the new doc
Call ws.CurrentDocument.Close
Call ws.EditDocument(True,wdoc)
Call ws.CurrentDocument.Refresh