Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-03-2018, 06:10 AM
DavidL DavidL is offline Find and Replace/Insert 'CR', delete leading Spaces wherever a user Clicks in a Word document Windows XP Find and Replace/Insert 'CR', delete leading Spaces wherever a user Clicks in a Word document Office 2007
Novice
Find and Replace/Insert 'CR', delete leading Spaces wherever a user Clicks in a Word document
 
Join Date: Apr 2018
Posts: 4
DavidL is on a distinguished road
Default Find and Replace/Insert 'CR', delete leading Spaces wherever a user Clicks in a Word document

Hi All,
I have text copied from various sources in different word files which I want to format in a particular style so as to match a given layout. Basically the text needs to be broken down into new lines/paragraphs at specific places which is given in the instructions. Instead of having to press 'Enter' and then remove/delete spaces at every line, I wish to do that with just one click per line using macro.
These files could be 500+ in number, so modifying all in one go using Macros is the preferred way.(Although I find it impossible when the point of insertion of 'Enter' can only be done manually on each file.) I have used Macros to achieve 90% of that however need one last step where a Macro can do the following:
1. Where ever the user clicks on the page, all space(regular, non-breaking space, white-space) until the next printed character is deleted.


2. An 'Enter' or Carriage-Return is inserted, so that the text moves to the next line.
Steps 1 and 2 are repeated at every click the user makes on the text.

[Example Text]
offer unto the LORD, have I given thee, and thy sons and thy daughters with thee, by a statute for ever: it is a covenant of salt for ever before the LORD unto thee and to thy seed with thee. 18:20 And the LORD spake unto Aaron, Thou shalt have no inheritance in their land, neither shalt thou have any part among them: I am thy part and thine inheritance among

[Expected Text]
offer unto the LORD, have I given thee,
and thy sons and thy daughters with thee,
by a statute for ever: it is a
covenant of salt for ever before the LORD
unto thee and to thy seed with thee.
18:20 And the LORD spake unto Aaron,
Thou shalt have no inheritance in their
land, neither shalt thou have any
part among them: I am thy
part and thine inheritance among

Notice that as 'Enter' is pressed at the end of these lines although they come in next line but usually a space character is there in front of those lines(appears in MS Word but not here in the forum's text window), which I wanted to remove automatically at one go.
Another approach is to click, delete the required spaces until the next character and then hit enter.
Something like Find ^w and Replace with ^p running at every place a user clicks, but with Macros.
Any help is appreciated.

Thanks,
David Lover
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and Replace/Insert 'CR', delete leading Spaces wherever a user Clicks in a Word document Find and Prompt the user to Replace Lawmuse Word VBA 9 02-27-2023 06:36 AM
Find and Replace/Insert 'CR', delete leading Spaces wherever a user Clicks in a Word document How to remove trailing & leading spaces in a cell? LearnerExcel Excel Programming 8 02-04-2018 08:22 PM
Find and Replace/Insert 'CR', delete leading Spaces wherever a user Clicks in a Word document Use Word VBA to find, delete and insert duplicate hyperlinks marceepoo Word VBA 2 12-30-2016 09:04 PM
Get rid of leading spaces before paragraphs fig000 Word 11 03-14-2016 01:59 PM
Find and Replace/Insert 'CR', delete leading Spaces wherever a user Clicks in a Word document Find and replace mutiple spaces between lowercase words only Dave T Word VBA 2 07-16-2015 11:23 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:20 AM.


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