WorkbookBase.HasRoutingSlip 属性

获取或设置一个值,该值指示工作簿是否具有传送名单。

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

语法

声明
Public Property HasRoutingSlip As Boolean
    Get
    Set
public bool HasRoutingSlip { get; set; }

属性值

类型:System.Boolean
如果工作簿具有传送名单,则为 true;否则为 false。

备注

将此属性设置为 true 可创建具有默认值的传送名单。 将此属性设置为 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 命名空间