共用方式為


WorkbookBase.Route 方法

使用活頁簿目前的傳閱名單傳送活頁簿。

命名空間:  Microsoft.Office.Tools.Excel
組件:  Microsoft.Office.Tools.Excel.v4.0.Utilities (在 Microsoft.Office.Tools.Excel.v4.0.Utilities.dll 中)

語法

'宣告
Public Sub Route
public void Route()

備註

傳送活頁簿會將 Routed 屬性設為 true。

範例

下列程式碼範例檢查 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 命名空間