Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7953557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:11:16+00:00 2026-06-04T03:11:16+00:00

UPDATED SCRIPT I’M USING THAT CAUSES LOCKUP…I tried replacing the (Replace:=wdReplaceOne) with (Replace:=wdReplaceAll), but

  • 0

UPDATED SCRIPT I’M USING THAT CAUSES LOCKUP…I tried replacing the (Replace:=wdReplaceOne) with (Replace:=wdReplaceAll), but still no such luck:

Option Explicit
'Dim strMacroName As String
 Dim spellingcorrectionsrep As Long

 Public Sub SpellingReview()
 Dim oShell, MyDocuments

‘Declaring the MyDocs filepath:
Set oShell = CreateObject(“Wscript.Shell”)
MyDocuments = oShell.SpecialFolders(“MyDocuments”)
Set oShell = Nothing

'   Set values for variables of the actual word to find/replace
spellingsuggestionsrep = 0
spellingcorrectionsrep = 0

'   Replacements

SpellingCorrections "dog", "dog (will be changed to cat)", False, True

'    END SEARCHING DOCUMENT AND DISPLAY MESSAGE

MsgBox spellingcorrectionsrep

'strMacroName = "Spelling Review"
'Call LogMacroUsage(strMacroName)

 End Sub
  Sub SpellingCorrections(sInput As String, sReplace As String, MC As Boolean, MW As     Boolean)

'   Set Selection Search Criteria
Selection.HomeKey Unit:=wdStory
With Selection
     With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Replacement.Highlight = True
    .Text = sInput
    .Replacement.Text = sReplace
    .Forward = True
    .Wrap = wdFindStop
    .Format = True
    .MatchWildcards = False
    .MatchCase = MC
    .MatchWholeWord = MW
End With
Do While .Find.Execute = True
    If .Find.Forward = True Then
        .Collapse Direction:=wdCollapseStart
    Else
        .Collapse Direction:=wdCollapseEnd
    End If

    If .Find.Execute(Replace:=wdReplaceOne) = True Then
    spellingcorrectionsrep = spellingcorrectionsrep + 1
    End If
    If .Find.Forward = True Then
        .Collapse Direction:=wdCollapseStart
    Else
        .Collapse Direction:=wdCollapseEnd
    End If
  Loop
  End With
 End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T03:11:17+00:00Added an answer on June 4, 2026 at 3:11 am

    Why not use it as a common procedure?

    Option Explicit
    
    Dim wordRep As Long
    
    Public Sub SpellingReview()
        Dim oShell, MyDocuments
    
        wordRep = 0
    
        SpellingCorrections "Dog", "Dog (will be changed to DOG)", False, True
    
        MsgBox wordRep
    End Sub
    
    Sub SpellingCorrections(sInput As String, sReplace As String, MC As Boolean, MW As Boolean)
        With ActiveDocument.Content.Find
            Do While .Execute(FindText:=sInput, Forward:=True, Format:=True, _
               MatchWholeWord:=MW, MatchCase:=MC) = True
               wordRep = wordRep + 1
            Loop
        End With
    
        With Selection.Find
            .ClearFormatting
            .Replacement.ClearFormatting
            .Replacement.Highlight = True
            .Text = sInput
            .Replacement.Text = sReplace
            .Forward = True
            .Wrap = wdFindContinue
            .Format = True
            .MatchCase = MC
            .MatchWholeWord = MW
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
            .Execute Replace:=wdReplaceAll
        End With
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script that waits until some row in a db is updated:
I'm trying to write a DML script that updates a column but I wanted
I'm new to js/jQuery. Forgive this horrible script. I'm lost. *(Updated with global variable
I want to enable auto update script in flex3. i am using below code
The following script will update the database, but it won't display the correct page
I've created a batch script to automatically update some files using wget for Windows.
I have the following script that successfully retrieves the current track and updates my
I have found a script that adds mouse trail on Opera's mouse gesture. Very
I'm having some issues with my code maybe you could help? Jquery: [updated] <script>
My PHP script serves files using readfile() and manually added HTTP headers. Files are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.