View Single Post
 
Old 01-21-2021, 12:53 PM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,370
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

The code you posted merely involves a lot of circumlocution to achieve the same result as:
Code:
ActiveDocument.ConvertNumbersToText (wdNumberAllNumbers)
Moreover, your use of:
Code:
wPara.range.Select
merely slows the code down (especially given that you never actually do anything with the resulting Selection) and, combined with the lack of:
Code:
Application.ScreenUpdating = False
results in a lot of screen flicker.

At the very most, all you need is:
Code:
Public Sub Flatten()
With ActiveDocument
  .ConvertNumbersToText (wdNumberAllNumbers)
  .Range.Style = wdStyleNormal
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote