DocumentBase.Name 屬性

取得文件名稱。

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

語法

'宣告
Public ReadOnly Property Name As String
    Get
public string Name { get; }

屬性值

型別:System.String
文件的名稱。

範例

下列程式碼範例會顯示訊息,說明文件的名稱。

若要使用本範例,請從文件層級專案中的 ThisDocument 類別執行它。

Private Sub DocumentName()
    MessageBox.Show(Me.Name)
End Sub 
private void DocumentName()
{
    MessageBox.Show(this.Name);
}

.NET Framework 安全性

請參閱

參考

DocumentBase 類別

Microsoft.Office.Tools.Word 命名空間