This documentation is archived and is not being maintained.

Document Property (General Extensibility)

Visual Studio .NET 2003

Returns the Document Object associated with the item, if one exists.

[Visual Basic .NET]
Public ReadOnly Property Document() As Document
[Visual Basic 6]
Property Get Document() As Document
HRESULT __stdcall get_Document(
   /* [out, retval] */ Document** retVal
Document Document {get;}
[JScript .NET]
public function get Document() : Document

Return Value

Returns a Document object.


For tool windows, Document returns Nothing.


Sub DocumentExample()
   ' Must have a project containing a document open before running this.
   Dim ProjItem As ProjectItem
   ProjItem = DTE.Solution.Projects.Item(1).ProjectItems.Item(3)
End Sub

See Also

Document Object | Documents Collection

Applies To: ProjectItem Object | Window Object