WorkbookBase.Subject 屬性
取得或設定寄件者或傳閱名單的主旨。
命名空間: Microsoft.Office.Tools.Excel
組件: Microsoft.Office.Tools.Excel.v4.0.Utilities (在 Microsoft.Office.Tools.Excel.v4.0.Utilities.dll 中)
語法
'宣告
Public Property Subject As String
public string Subject { get; set; }
屬性值
型別:System.String
寄件者或傳閱名單的主旨。
備註
將 Microsoft.Office.Interop.Excel.RoutingSlip 的主旨當做傳閱活頁簿的郵件主旨。
範例
下列程式碼範例檢查 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 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。