Results 1 to 9 of 9
  1. #1
    Star Lounger
    Join Date
    Feb 2001
    Location
    USA
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Autocorrect entries

    Does anyone know if there is a way to "globally" apply new autocorrect entries? I am going to create a lot of new autocorrect entries and I need to apply them to several documents already created. I am using Word 2000/SR-1.
    Thanks for any help given.
    Ruth

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Autocorrect entries

    Actually there is a way. Two quite possibly:

    1. Since unformatted autocorrect entries are stored in a file named username.acl in either the Windows or Winnt folder, you can replace that file with a "global" list.

    You just have to make sure that 1) all intended autocorrect entries are in your "master" file and 2) you have some means of naming your master file according to each user's log in name. I've not tested this method, so you're on your own. But the next one works.

    2. Use VBA to write a macro to do it. You've got several options as to how to get each user to run the macro, so that's up to you. But this snippet should get you started:

    Application.AutoCorrect.Entries.Add Name:="(tnt)", Value:= "dynamite"
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    BAM
    Guest

    Re: Autocorrect entries

    Hi Ruth,

    Not exactly. AutoCorrect entries are only applied "As you type".

    I think what you are looking for is a macro for each search string using Find/Replace and run it on all of the documents. This can easily be done via Tools/Macro/Record New Macro.
    ~~~~~~~~~~~~~
    Cheers! <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  4. #4
    Star Lounger
    Join Date
    Feb 2001
    Location
    USA
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Autocorrect entries

    I found a macro on Microsoft's site. It appears to skip some of the entries I have such as correcting A-series with A Series. There is also the entry to change i to I and ascii to ASCII. When the macro came to ASCII, it wanted to know if I wanted to change i to I. It would not let me say no. Every time I clicked no, the message just stayed there. I finally had to say yes to get it to continue. It then changed ASCII to I. I know next to nothing about macros. I am attaching it to this post. Can you tell me if there is a way to change it to pick up the words with dashes in them or what to do with the "i" issue?

    Thanks

    Ruth

    macro: (the first four lines go into the "declarations" section.)

    Option Explicit

    Dim anEntry
    Dim myMatch
    Dim myConfirm

    Sub ReplaceAutoCorrectText()

    Application.ScreenUpdating = True
    Selection.HomeKey unit:=wdStory, Extend:=wdMove

    With ActiveDocument.Content.Find
    .ClearFormatting

    Do While .Execute(FindText:=" ", Forward:=True, Format:=True) = True

    Selection.MoveRight unit:=wdWord, Count:=1, Extend:=wdExtend

    For Each anEntry In AutoCorrect.Entries
    If anEntry.Name = Selection Then
    Selection.Words(1).Select
    myMatch = True
    myConfirm = MsgBox("Are you sure you want to replace " _
    & Chr$(34) & anEntry.Name & Chr$(34) & " with " & Chr$(34) _
    & anEntry.Value & Chr$(34) & "?", vbYesNo)
    If myConfirm = vbYes Then
    Selection.TypeText (anEntry.Value)
    Exit For
    End If
    End If
    Next anEntry

    Selection.MoveLeft unit:=wdCharacter, Count:=1, Extend:=wdExtend

    For Each anEntry In AutoCorrect.Entries
    If anEntry.Name = Selection Then
    Selection.Words(1).Select
    myMatch = True
    myConfirm = MsgBox("Are you sure you want to replace " _
    & Chr$(34) & anEntry.Name & Chr$(34) & " with " & Chr$(34) _
    & anEntry.Value & Chr$(34) & "?", vbYesNo)
    If myConfirm = vbYes Then
    Selection.TypeText (anEntry.Value) & " "
    Exit For
    End If
    End If
    Next anEntry

    Selection.MoveRight unit:=wdCharacter, Count:=1, Extend:=wdMove

    Loop
    End With
    End Sub

  5. #5
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,049
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: Autocorrect entries

    Hi Kevin,

    I read the original post to request a way to run autocorrect on existing documents, rather than change each user's system. Could be I misunderstood, wouldn't be the first (or last) time.

    If trying to copy AutoText libraries (and there may be multiple such libraries on a computer since they are both user and language dependant) I would recommend using the macro downloadable from <A target="_blank" HREF=http://www.mvps.org/word/FAQs/Customization/ExportAutocorrect.htm> How can I import and export all my AutoCorrect entries, so they can be transferred to another machine?</A> I would recommend using the second method which produces a Word table and allows you to edit or delete entries you don't need. That macro also allows you to simply add your global entries to others rather than replacing them.

    Hope this helps. (edited 6-28 to correct links in signature)
    Charles Kyle Kenyon
    Madison, Wisconsin

  6. #6
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,049
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: Autocorrect entries

    No, there is no way that I know of doing this. Are we talking AutoCorrect and not AutoText?

    With AutoText it is possible when initially preparing the document to insert an AutoText field instead of just the text. Then if the AutoText is updated in the global template (or document template) it will automatically update in the documents and templates that use the field for that entry.

    You could do a find/replace for your files that might help. See <A target="_blank" HREF=http://www.mvps.org/word/FAQs/MacrosVBA/BatchFR.htm> How to Find & ReplaceAll on a Batch of Documents in the Same Folder</A> on the MVP FAQ page.

    Hope this helps. (edited 6-28 to correct links in signature)
    Charles Kyle Kenyon
    Madison, Wisconsin

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Autocorrect entries

    This macro works differently, but the "A-Series" problem will be the same because it, too, relies on what Word considers to be a word, and internal punctuation does not fit MS' notion of what a word is. Nevertheless, maybe it will help:

    Sub eXpandAutoCorrect()
    ' Created 6/28/01 Jefferson Scher
    ' Expand every word that corresponds to an AutoText entry
    ' Note: plain text only, range approach, formatting may be lost
    Dim wrd As Range, intSpace1 As Integer, intSpaces As Integer
    On Error GoTo NoSuch
    For Each wrd In ActiveDocument.Words
    'preserve trailing spaces
    intSpace1 = InStr(1, wrd.Text, " ", vbTextCompare)
    If intSpace1 > 0 Then
    intSpaces = Len(wrd.Text) - intSpace1 + 1
    Else
    intSpaces = 0
    End If
    'if there is no corresponding AC, the word is not changed
    wrd.Text = AutoCorrect.Entries(Trim(wrd)).Value & Space(intSpaces)
    NeverMind:
    Next

    MsgBox "Done!"
    Exit Sub

    NoSuch:
    Resume NeverMind

    End Sub

    This kind of error handling is not elegant, but compared with looping through the AutoCorrect collection, it should be faster. Note: If it is critical to have a case sensitive match, then additional code would be required. (I don't understand the i/I problem.)

  8. #8
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Autocorrect entries

    Ruth,

    Not a criticsm at all.

    But check out the post on <A target="_blank" HREF=http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Cat=&Board=ann&Number=30349&page=0 &view=expanded&sb=5&o=0&part=>Posting code in the forum</A>

    Just in case you woule like to make that code look neat!
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  9. #9
    Star Lounger
    Join Date
    Feb 2001
    Location
    USA
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Autocorrect entries

    Geoff,

    ANY help is appreciated. As I said in my earlier post, I know NOTHING about macros. So, your message was very helpful. Thanks.
    I have found another way around this problem. I have just recorded a macro doing a Find/Replace and have just been adding the autocorrect entries that I had difficulties with the other macro. It is time consuming, but it does what I want it to do!
    Thanks for your help. I will put the information you have given me and keep it for in the future.

    Ruth

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •