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
    Get
    Set
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 安全性

请参见

参考

WorkbookBase 类

Microsoft.Office.Tools.Excel 命名空间