Aslo der Code sieht so aus
Sub Submit
REM Subroutine to sign new BMT Order and to send it to accountant
Dim uiwork As New Notesuiworkspace
Dim maildoc As Notesdocument
Dim rtitem As NotesRichTextItem
Dim answer As Integer
On Error Goto ErrorHandle
Set uidoc=uiwork.CurrentDocument
Set doc=uidoc.Document
If Not OrderIsReady(uidoc) Then Exit Sub
answer=Messagebox("Are you sure that you want to sign this document?",36, dbtitle)
If answer<>6 Then Exit Sub
uidoc.EditMode=True
If(doc.accountant(0) <> "" ) Then
Call doc.ReplaceItemValue("StageG",10)
End If
If(doc.accountant2(0) <> "" ) Then
Call doc.ReplaceItemValue("StageG",20)
End If
Set maildoc=doc.Parentdatabase.CreateDocument
maildoc.SendTo=doc.AccountantEMail
maildoc.SendTo= Arrayappend(maildoc.SendTo, doc.AccountantEMail2)
maildoc.SendTo= Arrayappend(maildoc.SendTo, doc.AccountantEMail3)
maildoc.SendTo= Arrayappend(maildoc.SendTo, doc.AccountantEMail4)
maildoc.SendTo= Arrayappend(maildoc.SendTo, doc.AccountantEMail5)
maildoc.SendTo= Arrayappend(maildoc.SendTo, doc.AccountantEMail6)
maildoc.SendTo= Arrayappend(maildoc.SendTo, doc.AccountantEMail7)
maildoc.SendTo= Arrayappend(maildoc.SendTo, doc.AccountantEMail8)
maildoc.SendTo= Arrayappend(maildoc.SendTo, doc.AccountantEMail9)
maildoc.SendTo= Arrayappend(maildoc.SendTo, doc.FachlichEMail)
maildoc.SendTo=Arrayappend(maildoc.SendTo, doc.ManagerEMail)
maildoc.SendTo=Arrayappend(maildoc.SendTo, doc.ManagerEMail1)
maildoc.SendTo=Arrayappend(maildoc.SendTo, doc.FachlichEMail1)
Set rtitem=New NotesRichTextItem(maildoc,"Body")
Call rtitem.AppendText("The following PCN order needs your approval. "+_
"Click on the icon below to review this document."+Chr$(13)+Chr$(13)+"- > ")
Call rtitem.AppendDocLink(doc,"")
Call doc.ReplaceItemValue("Stage",10)
'AssignReqNum
Call uidoc.refresh
Call doc.ReplaceItemValue("RDate", Date)
Call uidoc.save
Print "Sending notification to accountant... Please wait"
maildoc.Subject="Process Change Notice: "+doc.LFD_Num(0)
' maildoc.Subject="BMT order "+doc.BMTnumber(0)
Call maildoc.Send(False)
Print " "
Call uidoc.close
ErrorHandle:
Dim status As String
status$ = "Fehler! " & ": " & Error()
Messagebox(status$)
hier nicht speichern
Exit Sub
End Sub