hcl-bot
February 2, 2005, 11:38am
1
Can anyone tell me why I get a “Cannot Execute Specified Command” when running the following code?
Following along in the debugger it happens on both the workspace.compose and the workspace.editdocument lines.
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = workspace.CurrentDocument
Dim doc As notesdocument
Set doc = uidoc.document
Dim collection As NotesDocumentCollection
Dim currentResponse As NotesDocument
Set collection = doc.Responses
Call uidoc.Save
If collection Is Nothing Then
Call workspace.ComposeDocument(“”,“Quote.nsf”,“OE”)
Else
Set currentResponse = collection.GetFirstDocument
Call workspace.EditDocument(False,currentResponse)
End If
hcl-bot
February 2, 2005, 12:56pm
2
Subject: Where is the code located? Agent? Form?
Subject: Answer To Your Questions.
I don’t have any PostOpen or QueryOpen scripts.
The code runs from an action button on the parent form. Code should either compose a new document when no response docs exist or edit the first response doc that it finds.
Subject: Now that I look again…
If collection.Count = 0 ThenCall workspace.ComposeDocument(“”,“Quote.nsf”,“OE”)
Else
Set currentResponse = collection.GetFirstDocument
Call workspace.EditDocument(False,currentResponse)
End If
Subject: Cannot Execute Specified Command
Could the problem be coming from code in the QueryOpen or PostOpen events of the form?