共用方式為


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
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 命名空間