Save Method

Applies To

Document object, Documents collection object, Template object, Versions collection object.

Description

Syntax 1: Saves the specified document or template. If the document or template hasn't been saved before, the Save As dialog box prompts the user for a file name.

Syntax 2: Saves all the documents in the Documents collection. If a document hasn't been saved before, the Save As dialog box prompts the user for a file name.

Syntax 3: Saves a version of the specified document with a comment.

Syntax 1

expression.Save

Syntax 2

expression.Save(NoPrompt, OriginalFormat)

Syntax 3

expression.Save(Comment)

expression Syntax 1: Required. An expression that returns a Document or Template object.

Syntax 2: Required. An expression that returns a Documents object.

Syntax 3: Required. An expression that returns a Versions object.

NoPrompt Optional Variant. True to have Word automatically save all documents. False to have Word prompt the user to save each document that has changed since it was last saved.

OriginalFormat Optional Variant. Specifies the way the documents are saved. Can be one of the following WdOriginalFormat constants: wdOriginalDocumentFormat, wdPromptUser, or wdWordDocument.

Comment Optional Variant. The comment string that's saved with the version.

See Also

Close method, DefaultSaveFormat property, Documents property, SaveAs method, Saved property, SaveInterval property.

Example

This example saves the active document if it's changed since it was last saved.

If ActiveDocument.Saved = False Then ActiveDocument.Save
This example saves each document in the Documents collection without first prompting the user.

Documents.Save NoPrompt:=True, OriginalFormat:=wdOriginalDocumentFormat
If Sales.doc is open, this example saves a version of Sales.doc, with a comment.

For Each doc in Documents
    If Instr(1, doc.Name, "Sales.doc", 1) > 0 Then 
        doc.Versions.Save Comment:="Minor changes to intro"
    End If
Next doc