Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #9  
Old 06-01-2021, 09:23 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Help with a logical code, end of paragraph lines Windows 10 Help with a logical code, end of paragraph lines Office 2019
Competent Performer
Help with a logical code, end of paragraph lines
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 200
Cendrinne is on a distinguished road
Default

I've added other stuff to fix paragraph endings. On a 11 pages of paragraphs, it took 5 min. Is there anyway, to speed it up? Why is it taking so long?


Code:
    Application.ScreenUpdating = False
    
    TST_End_of_Sentence_                                            'suggested by Guessed
    
    Options.DefaultHighlightColorIndex = wdBrightGreen
    
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Replacement.Highlight = True
    With Selection.Find
        .Forward = True
        .Wrap = wdFindStop
        .Format = True
        .MatchCase = True
        .MatchWildcards = True
    
        .Text = "(\(*>)^32"
        .Replacement.Text = "\1^s"                                  'suggested by Macropod
        .Execute Replace:=wdReplaceAll
    
        .Text = "(*>)^32(A-Z)"
        .Replacement.Text = "\1^s\2"
        .Execute Replace:=wdReplaceAll
    
    Options.DefaultHighlightColorIndex = wdYellow
    
        .Text = "(«)^32(<*)"                                            '«
        .Replacement.Text = "\1^s\2"
        .Execute Replace:=wdReplaceAll
    
        .Text = "(>)^32(»)"                                            '»
        .Replacement.Text = "\1^s\2"
        .Execute Replace:=wdReplaceAll
        
        .Text = "([%$])"                                               '$%
        .Replacement.Text = "^s\1"
        .Execute Replace:=wdReplaceAll
    
    Options.DefaultHighlightColorIndex = wdTurquoise
    
        .Text = "([0-9]>)^32(millio[ns]@)"                             '0-9 millions
        .Replacement.Text = "\1^s\2"
        .Execute Replace:=wdReplaceAll
    
        .Text = "(rie>)^32([A-Z0-9])"                                  'serie 0-9 / categorie A-Z
        .Replacement.Text = "\1^s\2"
        .Execute Replace:=wdReplaceAll
    
        .Text = "([0-9]{4})-([0-9])"
        .Replacement.Text = "\1^~\2"
        .Execute Replace:=wdReplaceAll

        .Text = "([0-9]>) (<[adfjmnos])"                           'Months
        .Replacement.Text = "\1^s\2"
        .Execute Replace:=wdReplaceAll
    
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

'Reset Find and Replace    
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ""
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindStop
        .Format = True
        .MatchCase = True
        .MatchWildcards = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

    Application.ScreenUpdating = True
Reply With Quote
 

Tags
help end of sentence, long paragraphs

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with a logical code, end of paragraph lines How to change the line spacing between just 2 lines within a paragraph Swarup Word 4 06-26-2019 02:32 PM
How to get rid of horizontal lines after each paragraph? Nisus Word 10 10-08-2018 01:15 PM
double spaced within paragraph 2 blank lines between paragraphs BigOldArt Word 1 08-24-2017 09:08 AM
Help with a logical code, end of paragraph lines Lines refuse to merge into one paragraph (Word 2010) Chris24 Word 2 01-22-2017 03:00 PM
Help with a logical code, end of paragraph lines Keep Paragraph Lines Together Issue SQLUSA Word 2 06-23-2012 05:00 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:11 PM.


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