使用英语阅读

通过


WorkbookBase.RoutingSlip 属性

获取一个 Microsoft.Office.Interop.Excel.RoutingSlip 对象,该对象表示工作簿的传送名单。

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

语法

声明
Public ReadOnly Property RoutingSlip As RoutingSlip
    Get
public RoutingSlip RoutingSlip { get; }

属性值

类型:Microsoft.Office.Interop.Excel.RoutingSlip
Microsoft.Office.Interop.Excel.RoutingSlip 对象,表示工作簿的传送名单。

备注

如果没有传送名单,读取此属性则会导致引发异常(首先检查 HasRoutingSlip 属性)。

示例

下面的代码示例检查 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 命名空间