共用方式為


WorkbookBase.Keywords 屬性

取得或設定附加至活頁簿的關鍵字。

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

語法

'宣告
Public Property Keywords As String
    Get
    Set
public string Keywords { get; set; }

屬性值

型別:System.String
附加至活頁簿的關鍵字。

備註

此屬性會對應至活頁簿 [屬性] 對話方塊中的 [關鍵字] 欄位。

範例

下列程式碼會設定 CommentsTitleTag 和 Keywords 屬性中的值,然後以程式設計方式顯示 Microsoft Office Excel [屬性] 對話方塊,驗證已設定這些值。

這是示範文件層級自訂的範例。

Private Sub AddWorkbookMetadata()
    Me.Comments = "This workbook contains sales data from 2004."
    Me.Title = "Sales Data"
    Me.Tag = "Sales"
    Me.Keywords = "Sales"
    Me.Application.Dialogs( _
        Excel.XlBuiltInDialog.xlDialogProperties).Show()
End Sub
private void AddWorkbookMetadata()
{
    this.Comments = "This workbook contains sales data from 2004.";
    this.Title = "Sales Data";
    this.Tag = "Sales";
    this.Keywords = "Sales";

    this.Application.Dialogs[
        Excel.XlBuiltInDialog.xlDialogProperties].Show(
        missing, missing, missing, missing, missing, missing,
        missing, missing, missing, missing, missing, missing,
        missing, missing, missing, missing, missing, missing,
        missing, missing, missing, missing, missing, missing,
        missing, missing, missing, missing, missing, missing);
}

.NET Framework 安全性

請參閱

參考

WorkbookBase 類別

Microsoft.Office.Tools.Excel 命名空間