Documents Property 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