![]() |
|
#1
|
|||
|
|||
![]() I need some macro help. I'm a moderate user, but this seems to be beyond my skill and the limits of the macro recorder. I'm trying to take all the text in the document, which may be a mix of different cases and has hard returns, and remove all the hard returns, then turn everything to uppercase. Bonus points if it also starts the spell check. |
#2
|
||||
|
||||
![]()
Not at all.
That said, try: Code:
Sub Demo() Application.ScreenUpdating = False With ActiveDocument.Range With .Find .Format = False .Forward = True .Wrap = wdFindContinue .Text = "[^13^l]{1,}" .Replacement.Text = " " .Execute Replace:=wdReplaceAll End With .Font.AllCaps = True .CheckSpelling End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
jimmy12 | Word VBA | 6 | 05-15-2021 02:48 AM |
Replacing a comment with underline or other formatting (or adding that formatting to commented text) | paulkaye | Word | 4 | 05-16-2016 05:38 AM |
![]() |
Instructor Mark | Word | 4 | 04-06-2016 01:32 PM |
![]() |
Dwellengers | Word VBA | 1 | 09-09-2015 06:24 AM |
![]() |
georgekung84 | Word VBA | 15 | 08-08-2012 06:28 PM |