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