This article describes how to open documents by using the Open and Repair feature in Microsoft Office Word 2002 and later versions.
Microsoft Word automatically uses the Open and Repair feature if Word detects a problem with a document when you open it. However, you can force Word to use the Open and Repair feature when you open any document. This may be especially useful when you intend to save the document in a different file format. If you save a damaged document in a different file format, you may not be able to open the saved document. For more information about how to troubleshoot damaged Word documents, click the following article number to view the article in the Microsoft Knowledge Base:
826864 How to troubleshoot damaged Word documents (for Word 2002 and 2003)
918429 How to troubleshoot damaged documents in Word 2007 and in Word 2010
To open a document by using the Open and Repair feature in Word, use one of the following methods.
Method 1: To open a specific document
To open a specific document by using the Open and Repair feature in Word, follow these steps:
On the File menu, click Open.
Note In Word 2007 or Word 2010, click the Microsoft Office Button, and then click Open.
In the Open dialog box, click to select the file that you want to open.
Click the down arrow on the Open button, and then click Open and Repair.
Method 2: To open all documents
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. To open all documents by using the Open and Repair feature in Word, replace the built-in FileOpen macro in Word with a Microsoft Visual Basic for Applications (VBA) macro. To do this, follow these steps:
Start Word, and then open a new blank document.
In Word 2007, click Macros on the Developer tab. In Word 2003, point to Macro on the Tools menu, and then click Macros.
Click the down arrow in the Macros in box, and then click Word commands.
In the Macro name list, click FileOpen.
Click the down arrow in the Macros in box, and then click Normal.dot (global template).
Note In Word 2007 and Word 2010, click Normal.dotm (global template).
The built-in FileOpen macro appears as in the following example:
Sub FileOpen()'' FileOpen Macro' Opens an existing document or template' Dialogs(wdDialogFileOpen).ShowEnd Sub
Replace the built-in FileOpen macro with the following macro example:
Option Explicit' WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS EXAMPLE IS' AT YOUR OWN RISK. Microsoft provides this macro code "as is" without warranty of' any kind, either expressed or implied, including but not limited to the implied ' warranties of merchantability and/or fitness for a particular purpose.Sub FileOpen()'' FileOpen Macro' Opens an existing document or template'Dim sFileName As String' Display the File Open dialog and capture the filename selected and pass it to a' variableWith Application.Dialogs(wdDialogFileOpen) .Display sFileName = .NameEnd With' Test to verify the filename has a value' If no file is chosen or if the Open dialog is dismissed, ' the following code is skippedIf sFileName <> "" Then ' Use the filename as a variable to be opened using Open and Repair feature Documents.Open FileName:=sFileName, OpenAndRepair:=TrueEnd IfEnd Sub
On the File menu, click Close and Return to Microsoft Word.
On the File menu, press SHIFT, and then click Save All.
The new FileOpen macro will run only if you open a document by using any one of the following methods:
You click Open on the File menu.
You click Open on the Standard toolbar.
The new FileOpen macro will not run if you open a document by using any one of the following methods:
You open the document in Windows Explorer.
You open the document from the most recently used (MRU) file list.