View Single Post
 
Old 01-19-2017, 05:31 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

On its own, the macro doesn't make any changes to your document. Evidently, though, your document contains some other volatile content that Word is updating. You might be able to prevent the unwanted 'Save' prompts with:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim i As Long, j As Long, bSvd As Boolean
With ActiveDocument
  bSvd = .Saved
  j = .ComputeStatistics(wdStatisticWords)
  With .Range
    With .Find
      .ClearFormatting
      .Replacement.ClearFormatting
      .Text = "[“" & Chr(34) & "]*[" & Chr(34) & "”]"
      .Replacement.Text = ""
      .Forward = True
      .Wrap = wdFindStop
      .Format = False
      .MatchWildcards = True
      .Execute
    End With
    Do While .Find.Found
      i = i + .ComputeStatistics(wdStatisticWords)
      .Collapse wdCollapseEnd
      .Find.Execute
    Loop
    MsgBox "This document contains " & j & " words ," & vbCr & _
      "of which " & i & " (" & Format(i * 100 / j, "0.00") & _
      "%) are in quotes."
  End With
  .Saved = bSvd
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote