Sub Initialize
Dim session As New NotesSession
Dim jobnumberList As Variant
Dim db As NotesDatabase
Dim docA As NotesDocument
Dim docB As NotesDocument
Dim DeleteMe As String
Dim collection As NotesDocumentCollection
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
Set docA = collection.GetFirstDocument()
If Instr(docA.ClientName_1(0),"; " ) = 1 Then
'If Instr(docA.ClientName_1(0), Chr$(13)) < 0 Then
'If Ubound(docA.CustomerJob) >0 Then
Else
If Not (docA Is Nothing) Then
jobnumberList = docA.GetItemValue("jobnumber")
Forall x In jobnumberlist
Set docB = New NotesDocument( db )
Call docA.CopyAllItems( docB, True )
docB.jobnumber = Instr(docA.jobnumber(0),";" ) = 1
docB.jobnumber = x
docB.clientname =""
docB.clientname_1 =""
docB.customer = ""
Call docB.ComputeWithForm(True, True)
Call docB.Save( True, True )
End Forall
End If
End If
If Instr(docA.ClientName_1(0),"; " ) = 0 Then
'If Instr(docA.ClientName_1(0), Chr$(13))>0 Then
'If Ubound(docA.CustomerJob) < 1 Then
docA.Remove(True)
End If
End Sub
|