#1
|
|||
|
|||
Macro to run a few text formatting changes
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 Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro to maintain formatting OR to delete all text (excluding comments) | 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 |
The Logic Behind Apply Formatting of Surrounding Text in Reveal Formatting Pane | Instructor Mark | Word | 4 | 04-06-2016 01:32 PM |
Use of macro disables paste text with source formatting? | Dwellengers | Word VBA | 1 | 09-09-2015 06:24 AM |
Macro for text formatting | georgekung84 | Word VBA | 15 | 08-08-2012 06:28 PM |