共用方式為


DocumentBase.Name Property

Gets the name of the document.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Syntax

'Declaration
Public ReadOnly Property Name As String
public string Name { get; }

Property Value

Type: System.String
The name of the document.

Examples

The following code example displays a message that shows the name of the document.

To use this example, run it from the ThisDocument class in a document-level project.

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

.NET Framework Security

See Also

Reference

DocumentBase Class

Microsoft.Office.Tools.Word Namespace