This documentation is archived and is not being maintained.

Saved Property (General Extensibility)

Visual Studio .NET 2003

Returns True if the object has not been modified since last being saved or opened.

[Visual Basic .NET]
Public Property Saved() As Boolean
[Visual Basic 6]
Property Get Saved() As Boolean
Property Let Saved( _
   ByVal NewValue As Boolean _
HRESULT __stdcall get_Saved(
   /* [out, retval] */ VARIANT_BOOL* retVal
HRESULT __stdcall put_Saved(
   /* [in] */ VARIANT_BOOL NewValue
bool Saved {get; set;}
[JScript .NET]
public function get Saved() : Boolean
public function set Saved(
   NewValue : Boolean


Determines whether a document should be saved, True if yes; False if no.

Return Value

True (default) if the object has not been modified since last being saved or opened.; False if otherwise.


The Saved property replaces the IsDirty property in Visual Studio version 6.0, but it returns the opposite value of IsDirty.


Sub SavedExample()
   ' Closes all saved documents in the project.
   Dim doc As Document
   Dim docs As Documents
   docs = DTE.Documents

   MsgBox("Number of open docs: " & DTE.Documents.Count)
   For Each doc In docs
      MsgBox("Closing " & doc.Name)
      If doc.Saved Then
      End If
End Sub 

See Also

IsOpen Property (General Extensibility) | SaveAs Method (General Extensibility)

Applies To: Document Object | Project Object | ProjectItem Object | Solution Object