![]() |
#1
|
|||
|
|||
![]() Office '07 I scanned a magazine page with OCR. The result of the OCR was displayed by a text reader. I cut and pasted the text into Word. The resultant text maintains the narrow column style of the magazine. I selected the entire text in Word hoping I could find a command that would release all the hard returns and allow the text to take the default Word right margin vs manually deleting the returns. No luck. Is there a way to do what I want? Mark I found the solution after a Google search: "MS Word allows the "carat p" symbol ^p (carat is the <shift> 6 key) to represent a carriage return in an MS-Word replace command." Last edited by markg2; 04-22-2012 at 04:51 PM. Reason: Found solution |
#2
|
|||
|
|||
![]()
Try AutoCorrect.
|
#3
|
|||
|
|||
![]()
I took a look and do not see any benefit. There is no hard return character option under find so it seems you'd have to enter the ^p in the find in any event.
|
#4
|
|||
|
|||
![]()
Sorry, I meant Autoformat. See http://wordfaqs.mvps.org/CleanWebText.htm
|
#5
|
|||
|
|||
![]() |
#6
|
||||
|
||||
![]()
Hi Mark,
The following macro cleans up text pasted from emails, websites, etc, that insert paragraph breaks at the end of every line. Note that the code assumes there are at least two such paragraph breaks between the 'real' paragraphs. Code:
Sub CleanUpPastedText() 'Turn Off Screen Updating Application.ScreenUpdating = False With ActiveDocument.Range.Find .ClearFormatting .Replacement.ClearFormatting .Forward = True .Wrap = wdFindStop .Format = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchWildcards = True 'Eliminate spaces & tabs before paragraph breaks. .Text = "[ ^s^t]{1,}^13" .Replacement.Text = "^p" .Execute Replace:=wdReplaceAll 'Replace single paragraph breaks with a space .Text = "([!^13])([^13])([!^13])" .Replacement.Text = "\1 \3" 'Replace all double spaces with single spaces .Execute Replace:=wdReplaceAll .Text = "[ ]{2,}" .Replacement.Text = " " 'Delete hypens in hyphenated text formerly split across lines .Execute Replace:=wdReplaceAll .Text = "([a-z])-[ ]{1,}([a-z])" .Replacement.Text = "\1\2" .Execute Replace:=wdReplaceAll 'Limit paragraph breaks to one per 'real' paragraph. .Text = "[^13]{1,}" .Replacement.Text = "^p" .Execute Replace:=wdReplaceAll End With 'Restore Screen Updating Application.ScreenUpdating = True End Sub For Mac macro installation & usage instructions, see: http://word.mvps.org/Mac/InstallMacro.html If you'd prefer to run the macro against just a selected range, change: ActiveDocument to: Selection
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
![]()
Thanks Paul,
The script description looks like what the doc ordered +. Would you mind pointing me in the direction of a link explaining how to install and invoke the script? If you remember, you had to do the same with the Excel script you provided a few years ago for my default workbook that's still in use with my every new spreadsheet :-). Mark Last edited by markg2; 04-23-2012 at 05:59 AM. Reason: Forgot salutation |
#8
|
||||
|
||||
![]()
Hi Mark,
That advice is included in post #6 itself
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
czytajsk | Word | 6 | 06-27-2012 05:03 PM |
Saving Emails to my Local Hard Drive | MichaelWaite | Outlook | 1 | 02-08-2012 06:53 AM |
IF formula returns TRUE instead of evaluating COUNTIF | ColinC | Excel | 4 | 12-28-2011 08:21 AM |
![]() |
LOUDONCLEAR | Outlook | 1 | 09-22-2011 06:13 PM |
New Hard Drive | abatson1995 | Office | 0 | 12-25-2009 02:13 PM |