Not sure if you want to only send mail to Repair Notify (and no one else) if it meets your conditions, or if you only want to include Repair Notify in the mailing (along with the others) if it meets your conditions. If it’s the latter then this should work:
Take the line that says
sendTo(3) = “Repair Notify”
and put this before it
If doc.dRes( 0 ) = “DEF” Then
and put this after it (thereby wrapping it)
End If
If it’s the former, then change these three lines
sendTo(1) = “Return Notify”
sendTo(2) = Doc.Salesman(0)
sendTo(3) = “Repair Notify”
to
If doc.dRes( 0 ) = “DEF” Then
sendTo(1) = “Repair Notify”
Else
sendTo(1) = “Return Notify”
sendTo(2) = Doc.Salesman(0)
sendTo(3) = “Repair Notify”
End If
Discuss This Question: