I am using Lotus Notes 6.5. I got this script from the web.The only problem that i have is when the user click on "cancel" the script still runs. Please help!
Thanks in advance....
Sub Click(Source As Button)
Dim nsesCurrent As New NotesSession
Dim nuiwsCurrent As New NotesUIWorkspace
Dim ndbCurrent As NotesDatabase
Dim ncolSelected As NotesDocumentCollection
Dim ndocOrder As NotesDocument
Dim StrExpireDate As String
StrExpireDate = nuiwsCurrent.Prompt(3,"New Field Value","Please enter the new field value.")
Set ndbCurrent = nsesCurrent.CurrentDatabase
Set nColSelected = ndbCurrent.UnprocessedDocuments
Set ndocOrder = ncolSelected.GetFirstDocument
Do While Not (ndocOrder Is Nothing)
With ndocOrder
.ExpireDate = StrExpireDate
End With
Call ndocOrder.Save(True, True)
Set ndocOrder = ncolSelected.GetNextDocument(ndocOrder)
Loop
End Sub
Thanks in advance....
Sub Click(Source As Button)
Dim nsesCurrent As New NotesSession
Dim nuiwsCurrent As New NotesUIWorkspace
Dim ndbCurrent As NotesDatabase
Dim ncolSelected As NotesDocumentCollection
Dim ndocOrder As NotesDocument
Dim StrExpireDate As String
StrExpireDate = nuiwsCurrent.Prompt(3,"New Field Value","Please enter the new field value.")
Set ndbCurrent = nsesCurrent.CurrentDatabase
Set nColSelected = ndbCurrent.UnprocessedDocuments
Set ndocOrder = ncolSelected.GetFirstDocument
Do While Not (ndocOrder Is Nothing)
With ndocOrder
.ExpireDate = StrExpireDate
End With
Call ndocOrder.Save(True, True)
Set ndocOrder = ncolSelected.GetNextDocument(ndocOrder)
Loop
End Sub