3

I want to use Microsoft Word to correct some plain text. But I need Word to use a list of new/custom spellcheck rules: e.g. replace 'fcarce' with 'scarce'. I could add each rule manually, but that would take hours if not days. Is there a way to add the entire list to Word?

P.S. I know how to add a custom dictionary. But it looks like a custom dictionary is merely a list of correctly-spelled words, when what I need is a list of incorrectly-spelled words and the correct spelling to replace them with.

3 Answers 3

0

I tried the macro recorder, and adding to autocorrect entries can be recorded. As an example, I added a correction of abc to ABC:

Sub Macro1()
AutoCorrect.Entries.Add Name:="abc", Value:="ABC"
With Options
    .AutoFormatAsYouTypeApplyHeadings = False
    .AutoFormatAsYouTypeApplyBorders = True
    .AutoFormatAsYouTypeApplyBulletedLists = True
    .AutoFormatAsYouTypeApplyNumberedLists = True
    .AutoFormatAsYouTypeApplyTables = True
    .AutoFormatAsYouTypeReplaceQuotes = True
    .AutoFormatAsYouTypeReplaceSymbols = True
    .AutoFormatAsYouTypeReplaceOrdinals = True
    .AutoFormatAsYouTypeReplaceFractions = True
    .AutoFormatAsYouTypeReplacePlainTextEmphasis = False
    .AutoFormatAsYouTypeReplaceHyperlinks = True
    .AutoFormatAsYouTypeFormatListItemBeginning = True
    .AutoFormatAsYouTypeDefineStyles = False
    .TabIndentKey = True
End With
With AutoCorrect
    .CorrectInitialCaps = True
    .CorrectSentenceCaps = True
    .CorrectDays = True
    .CorrectCapsLock = True
    .ReplaceText = True
    .ReplaceTextFromSpellingChecker = True
    .CorrectKeyboardSetting = False
    .DisplayAutoCorrectOptions = True
    .CorrectTableCells = True
End With
With OMathAutoCorrect
    .UseOutsideOMath = False
    .ReplaceText = True
End With
With Options
    .AutoFormatApplyHeadings = True
    .AutoFormatApplyLists = True
    .AutoFormatApplyBulletedLists = True
    .AutoFormatApplyOtherParas = True
    .AutoFormatReplaceQuotes = True
    .AutoFormatReplaceSymbols = True
    .AutoFormatReplaceOrdinals = True
    .AutoFormatReplaceFractions = True
    .AutoFormatReplacePlainTextEmphasis = True
    .AutoFormatReplaceHyperlinks = True
    .AutoFormatPreserveStyles = True
    .AutoFormatPlainTextWordMail = True
End With
Options.LabelSmartTags = False
End Sub

Clearly, I only just found out by recording, so I'm not sure which of these options are required but these are the defaults. But the VBA code you're looking for is AutoCorrect.Entries.Add.

0

For autocorrects you can do this. Requires VBA. This version only substitutes plain text, not rich text. AFAIK it works on Win Word 2010 (and probably 2007/2013) and Mac Word 2011.

(Autocorrects basically only allow "rules" where one specific word is replaced by another text - as far as I know there are no facilities to check grammatical stuff such as plural versions of words, or to do any sort of wildcarding)

Create a Word document containing one table with two columns. Save your document.

Put "From" in the top cell of the first column. Put "To" in the top cell of the second column.

Let's suppose you have 100 rules.

For each rule, you need one row in the table. Put the text you want to detect in the first cell of the row and the text you want to replace it by in the second cell of the row.

An autocorrect in this table will replace any existing autocorrect with the same "from", so be careful what you put in this table.

When you're done, save your work.

Then you need to insert the following VBA and run it. For some rather out-of-date assistance on that, see this link

Sub importautocorrects()
Dim objACE As Word.AutoCorrectEntry
Dim objDocument As Word.Document
Dim r As Word.Range
Dim objTable As Word.Table
Dim i As Integer
Set objDocument = ActiveDocument
Set objTable = objDocument.Tables(1)
For i = 2 To objTable.Rows.Count
  With objTable.Rows(i)
      Word.AutoCorrect.Entries.Add _
        Left(.Cells(1).Range.Text, _
        Len(.Cells(1).Range.Text) - 2), _
        Left(.Cells(2).Range.Text, _
        Len(.Cells(2).Range.Text) - 2)
  End With
Next
Set objTable = Nothing
Set objDocument = Nothing
End Sub
-1

To add corrections, open Word and click on File > Options

In the options window, click on Proofing. Here you'll find anything you need about proofing settings. If you click "autocorrect options", you can also add "as you type corrections"; I think that's what you're looking for!

Here is the screenshot:

screenshot for options

1
  • This is how you add rules manually. The question asks for a way to add a list in some faster way. Dec 19, 2014 at 8:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .