Document.Subject 屬性 (Visio)Document.Subject property (Visio)

取得或設定文件摘要資訊中 [主旨] 欄位的值。Gets or sets the value of the Subject field in a document's properties. 可讀寫。Read/write.

語法Syntax

運算式主旨expression.Subject

_運算式_代表**Document** 物件的變數。expression A variable that represents a Document object.

傳回值Return value

字串String

備註Remarks

Subject屬性的設定相當於在 [屬性] 對話方塊的 [主旨] 方塊中輸入資訊 (按一下 [檔案] 索引標籤,按一下 [資訊],按一下 [內容],然後按一下進階內容)。Setting the Subject property is equivalent to entering information in the Subject box in the Properties dialog box (click the File tab, click Info, click Properties, and then click Advanced Properties).

範例Example

下列的 Microsoft Visual Basic for Applications (VBA) 巨集會示範如何使用 Subject 屬性來記錄繪圖的主旨。This Microsoft Visual Basic for Applications (VBA) macro shows how to use the Subject property to document the subject of a drawing. 它會將 Document 物件新增到 Documents 集合,並設定 Document 物件的 Subject 屬性以及其他的文件摘要資訊。It adds a Document object to the Documents collection and sets the Document object's Subject property as well as other document properties.

在執行這個巨集之前,請用您的值來替代下列程式碼中的斜體字項目。Before running this macro, substitute your own values for the items in italic in the following code. 若要驗證是否已設定這些屬性,請開啟 [屬性] 對話方塊。To verify that these properties have been set, open the Properties dialog box.

 
Public Sub Subject_Example() 
 
    Dim vsoDocument As Visio.Document  
 
    Set vsoDocument = Documents.Add("")  
 
    'Set the properties of the document.  
    vsoDocument.Title = "document title "  
    vsoDocument.Creator = "author name "  
    vsoDocument.Description = "document description "  
    vsoDocument.Keywords = "keyword1, keyword2, keyword3 "  
    vsoDocument.Subject = "document subject "  
    vsoDocument.Manager = "manager name "  
    vsoDocument.Category = "document category "  
 
End Sub

支援和意見反應Support and feedback

有關於 Office VBA 或這份文件的問題或意見反應嗎?Have questions or feedback about Office VBA or this documentation? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.