Export (0) Print
Expand All
ID
Top
Expand Minimize
This topic has not yet been rated - Rate this topic

Name Property (General Extensibility)

Visual Studio .NET 2003

Sets or returns the name of the object.

[Visual Basic .NET]
Public ReadOnly Property Name() As String
[Visual Basic 6]
Property Get Name() As String
[C++]
HRESULT __stdcall get_Name(
   /* [out, retval] */ BSTR* retVal
);
[C#]
string Name {get;}
[JScript .NET]
public function get Name() : String

Parameters

Name
Required. The name of the object.

Remarks

Example

Sub NameExample()
  Dim doc As Document
  Dim desc As String

  Set doc = DTE.ActiveDocument
  desc = "You are editing a "
  If (doc.ReadOnly) Then
    desc = desc & "read-only"
  Else
    desc = desc & "writable"
  End If
  desc = desc & " document called " & doc.Name & " located at " & doc.Path
  MsgBox desc
End Sub

See Also

Applies To: AddIn Object | Breakpoint Object | CodeAttribute Object | CodeClass Object | CodeDelegate Object | CodeElement Object | CodeEnum Object | CodeFunction Object | CodeInterface Object | CodeNameSpace Object | CodeParameter Object | CodeProperty Object | CodeStruct Object | CodeType Object | CodeVariable Object | ColorableItems Object | Command Object | Configurations Collection | ContextAttribute Object | Document Object | Expression Object | ICoclassInfo Object | IControl Object | IEnumInfo Object | IFuncInfo Object | IInterfaceInfo Object | IParamInfo Object | ITypeLibInfo Object | IVarInfo Object | Language Object | OutputWindowPane Object | Process Object | Program Object | Project Object | ProjectItem Object | Property Object | SelectedItem Object | SolutionConfiguration Object | Thread Object | ToolBoxItem Object | ToolBoxTab Object | UIHierarchyItem Object | VCCodeAttribute Object | VCCodeBase Object | VCCodeClass Object | VCCodeDelegate Object | VCCodeElement Object | VCCodeEnum Object | VCCodeEvent Object | VCCodeFunction Object | VCCodeIDLCoClass Object | VCCodeIDLImport Object | VCCodeIDLImportLib Object | VCCodeIDLLibrary Object | VCCodeImport Object | VCCodeInclude Object | VCCodeInterface Object | VCCodeMacro Object | VCCodeMap Object | VCCodeMapEntry Object | VCCodeNamespace Object | VCCodeParameter Object | VCPlatform Object | VCCodeProperty Object | VCCodeStruct Object | VCCodeTypedef Object | VCCodeUnion Object | VCCodeUsing Object | VCCodeVariable Object | VCConfiguration Object | VCFile Object | VCFileConfiguration Object | VCFilter Object | VCPlatform Object | VCProject Object | VCStyleSheet Object | WindowConfiguration Object

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.