WorkbookBase.Route 方法

使用工作簿的当前传送名单传送工作簿。

命名空间:  Microsoft.Office.Tools.Excel
程序集:  Microsoft.Office.Tools.Excel.v4.0.Utilities(在 Microsoft.Office.Tools.Excel.v4.0.Utilities.dll 中)

语法

声明
Public Sub Route
public void Route()

备注

传送工作簿可将 Routed 属性设置为 true。

示例

下面的代码示例检查 Routed 属性的值,以确定工作簿是否已传送。 如果工作簿尚未传送,则此示例将 HasRoutingSlip 属性设置为 true,将 Subject 属性设置为用于传送名单的主题行,然后使用 RoutingSlip 属性调整传递类型、消息和收件人。 最后,此示例调用 Route 方法传送工作簿。

此示例针对的是文档级自定义项。

Private Sub RouteWorkbook()
    If Not Me.Routed Then
        Me.HasRoutingSlip = True
        Me.Subject = "Here is the forecast spreadsheet."

        Dim routingSlip As Excel.RoutingSlip = Me.RoutingSlip
        routingSlip.Delivery = Excel.XlRoutingSlipDelivery.xlOneAfterAnother
        routingSlip.Message = "Please review and provide your feedback."
        routingSlip.Recipients = New String() _
            {"Don Hall", "Sydney Higa", "Ron Gabel"}
        Me.Route()
    End If
End Sub
private void RouteWorkbook()
{
    if (!this.Routed)
    {
        this.HasRoutingSlip = true;
        this.Subject = "Here is the forecast spreadsheet.";

        Excel.RoutingSlip routingSlip = this.RoutingSlip;
        routingSlip.Delivery = Excel.XlRoutingSlipDelivery.xlOneAfterAnother;
        routingSlip.Message = "Please review and provide your feedback.";
        routingSlip.set_Recipients(0,
            new string[] { "Don Hall", "Sydney Higa", "Ron Gabel" });
        this.Route();
    }
}

.NET Framework 安全性

请参见

参考

WorkbookBase 类

Microsoft.Office.Tools.Excel 命名空间