Article ID: 210869 - View products that this article applies to.
This article was previously published under Q210869
This article has been archived. It is offered "as is" and will no longer be updated.
The AutoCorrect feature works dynamically when you type a space after a word that appears in the AutoCorrect list. This feature operates while you create the document, but Word does not automatically scan a previously-created document and make AutoCorrect changes.
This article provides a sample macro that compares each word in a Word document to words in the AutoCorrect list and then replaces the matched words with the text string specified in the AutoCorrect list.
NOTE: If you are working on a very long document, this macro may take a long time to run. To stop the macro before it is finished, press CTRL+BREAK and then click End when you receive the following Microsoft Visual Basic message:
When you save the document, Word saves all changes you made up until you pressed CTRL+BREAK.
Code execution has been interrupted
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.
For more information about how to use the sample code in this article, click the article number below to view the article in the Microsoft Knowledge Base:
212536Place the following code in the Declarations section of your code page:
(http://support.microsoft.com/kb/212536/EN-US/ )OFF2000: How to Run Sample Code from Knowledge Base Articles
Create the following macro to search your active document, identify words that appear in both the document and the AutoCorrect list, prompt you to replace the word, and then insert the corresponding AutoCorrect text.
For additional information about the AutoCorrect feature in Word, click the article numbers below to view the articles in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/212377/EN-US/ )WD2000: General Information About Auto Features
(http://support.microsoft.com/kb/207748/EN-US/ )WD2000: How to Move Word AutoCorrect Entries Between Computers
212518For additional information about programming resources for Microsoft Word 2000, click the article numbers below to view the articles in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/212518/EN-US/ )WD2000: How to Print a List of AutoCorrect Entries
(http://support.microsoft.com/kb/212623/EN-US/ )WD2000: Macro Programming Resources
(http://support.microsoft.com/kb/226118/EN-US/ )OFF2000: Programming Resources for Visual Basic for Applications