April 2006
Beginner
1114 pages
98h 16m
English
routingslip.Recipients [= setting]
Sets or returns an array containing the addresses of the recipients to include in the To field of the email. The order of the items in the array determines the order of delivery.
Setting this property displays an Outlook security warning. Don’t run code to set this property from within the Visual Basic Editor (as when debugging) since it may cause Excel to lock up.
You can use the Split function to convert a string containing multiple addresses into an array, as shown here:
' Don't run this from VBE! Use Tools>Macros>Macro>Run instead.
Sub RouteActiveWorkbook( )
Dim wb As Workbook, rs As RoutingSlip
' Trap error in case user cancels send.
On Error Resume Next
Set wb = ActiveWorkbook
' Get the routing slip.
Set rs = wb.RoutingSlip
' Clear it.
rs.Reset
' Set routing list. Use Split to convert address list to array.
rs.Recipients = Strings.Split("someone@microsoft.com;" & _
"someone@yourcompany.com;someoneelse@yourcompany.com", ";")
rs.Subject = wb.Name
rs.Message = "Please review and route on."
' Send the message.
wb.Route
On Error GoTo 0
End SubRead now
Unlock full access