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
[C++]
HRESULT __stdcall get_Document(
   /* [out, retval] */ Document** retVal
);
[C#]
Document Document {get;}
[JScript .NET]
public function get Document() : Document

Return Value

Returns a Document object.

Remarks

For tool windows, Document returns Nothing.

Example

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)
   MsgBox(ProjItem.Document.FullName)
End Sub

See Also

Document Object | Documents Collection

Applies To: ProjectItem Object | Window Object

Show: