Word Macro: Saving All Files Without Looping

I’ve described a Word VBA macro that saves all files.
Actually, we can save all files without looping.
Here is the macro.

Macro Example

Sub SavingAllFilesWithoutLoop()
  Documents.Save NoPrompt:=True

End Sub


We need only the following code:

  Documents.Save NoPrompt:=True

That’s all.

The Application.Documents property returns the Documents collection object.


The Documents property is a member of the Word.Global class, so we can omit the Application property.


The Documents is a collection of all the Document objects those are currently open in Word.


The Documents collection object has the Save method.


This Documents.Save method allows us to save all files without looping.
And we are providing the NoPrompt parameter, NoPrompt:=True.

  Documents.Save NoPrompt:=True

This defines to save all documents automatically.

If there are unsaved files, those are ignored.



Apply To

  • Word 2013
  • Word 2010
  • Word 2007