Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-14-2021, 05:26 PM
Badger75 Badger75 is offline Macro to run a few text formatting changes Windows 10 Macro to run a few text formatting changes Office 2019
Novice
Macro to run a few text formatting changes
 
Join Date: May 2021
Posts: 1
Badger75 is on a distinguished road
Default 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.
Reply With Quote
  #2  
Old 05-14-2021, 09:28 PM
macropod's Avatar
macropod macropod is offline Macro to run a few text formatting changes Windows 10 Macro to run a few text formatting changes Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

Quote:
Originally Posted by Badger75 View Post
this seems to be beyond ... the limits of the macro recorder.
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]
Reply With Quote
Reply

Thread Tools
Display Modes


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

Other Forums: Access Forums

All times are GMT -7. The time now is 08:46 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft