WorkbookBase.Routed 属性

获取一个值,该值指示工作簿是否已传送给下一个收件人。

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

语法

声明
Public ReadOnly Property Routed As Boolean
    Get
public bool Routed { get; }

属性值

类型:System.Boolean
如果工作簿已传送给下一个收件人,则为 true;如果工作簿需要传送,则为 false。

备注

如果工作簿未传送给当前收件人,则此属性始终为 false(例如,如果文档没有传送名单,或传送名单刚刚创建)。

示例

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