Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help with MessageBox and Error Handling

Status
Not open for further replies.

imjamesw

MIS
Mar 6, 2003
1
FR
Hello All

I need some assitance with the following script.

What I would like the Messagebox to show is

If doc.approver_1(0) <> &quot;&quot; Then emailDoc.CopyTo = doc.RequesterName(0) is true then show that and Sendpeople in a messagebox , if not true then show only the Sendpeople value. I think this will require two messagebox statements I am not sure how to write it.

Also with my error handling I will need to show the same values as above. I am not sure about the placement of the On Error Goto ErrorSending within this script. Is there any way to test the error handling

Regards

James
Code:
Print &quot;SendingNotification&quot;
     PromptTitle = doc.PromptTitle
     Stop
     Dim emailDoc As New NotesDocument( db ) 
'Set some fields on the document
     doc.FormStatus = &quot;RAP&quot;
     doc.DocStatus = &quot;Waiting for Coordinator&quot;
     doc.StatusApp = &quot;Approval Complete&quot;
     doc.ACoorDate1= Date
     doc.CoordSubmit = &quot;Sent&quot;
'E-mail those who need to know
     emailDoc.Form = &quot;Memo&quot;
     emailDoc.SendTo = doc.Coordinator(0) 
     If doc.approver_1(0) <> &quot;&quot; Then emailDoc.CopyTo = doc.RequesterName(0)
     
     emailDoc.BlindCopyTo = &quot;&quot;
     emailDoc.Subject = doc.PDI_ID(0) & &quot;is waiting for your action. Approval is complete&quot;
'Create the body field and put in a doclink
     Set rtitem = New NotesRichTextItem(emailDoc, &quot;Body&quot;)
     Call rtitem.AppendDocLink(doc, &quot;Link to document&quot;)
     
'Compute the computed fields
     Call emailDoc.ComputeWithForm(False, False)
'Send the e-mail
     Call emailDoc.Send (False)
     On Error Goto ErrorSending
     
     Messagebox &quot;Notification has been sent to &quot; & doc.Coordinator(0) +&quot;. &quot; +  doc.RequesterName(0) & &quot;.&quot;, 0 + 64, PromptTitle(0)
     Exit Sub
     
ErrorSending:
     Messagebox &quot;FYI:  &quot; & doc.Coordinator(0) +&quot;. &quot; +doc.RequesterName(0) & &quot; could not be notified via email at this time.&quot;, 0 + 64, PromptTitle(0)
     Exit Sub
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top