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 _
) 
[C++]
HRESULT __stdcall get_Saved(
   /* [out, retval] */ VARIANT_BOOL* retVal
);
HRESULT __stdcall put_Saved(
   /* [in] */ VARIANT_BOOL NewValue
);
[C#]
bool Saved {get; set;}
[JScript .NET]
public function get Saved() : Boolean
public function set Saved(
   NewValue : Boolean
)

Parameters

NewValue
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.

Remarks

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

Example

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
         doc.Close()
      End If
   Next
End Sub 

See Also

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

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

Show: