Documents Property
Applies To
Application object, Global object.
Description
Returns a Documents collection that represents all the open documents. Read-only.
See Also
ActiveDocument property, Add method (Documents collection), Close method, Open method, Save method.
Example
This example creates a new document based on the Normal template and then displays the Save As dialog box.
Documents.Add.Save
This example saves open documents that have changed since they were last saved.
For Each aDoc In Documents
If aDoc.Saved = False Then aDoc.Save
Next aDoc
This example prints each open document after setting the left and right margins to 0.5 inch.
For Each openDoc In Documents
With openDoc
.PageSetup.LeftMargin = InchesToPoints(0.5)
.PageSetup.RightMargin = InchesToPoints(0.5)
.PrintOut
End With
Next openDoc
This example opens MyDoc.doc as a read-only document.
Documents.Open FileName:="C:\MyFiles\MyDoc.doc", ReadOnly:=True