Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-03-2023, 04:05 AM
balavaka balavaka is offline I making too long Help me Windows 10 I making too long Help me Office 2013
Novice
I making too long Help me
 
Join Date: May 2021
Posts: 25
balavaka is on a distinguished road
Default I making too long Help me

Is there any other way to achieve the following?

Code:
Sub Macro2()
    Selection.Find.ClearFormatting
    Selection.Find.replacement.ClearFormatting
    Selection.Find.replacement.Highlight = True
    With Selection.Find.replacement.ParagraphFormat
        .SpaceBeforeAuto = False
        .SpaceAfterAuto = False
        .Alignment = wdAlignParagraphCenter
    End With
    With Selection.Find
        .text = _
            "Received^32([0-9]{1,2})^32([A-z]{1,})^32([0-9]{4})^13Revised^32([0-9]{1,2})^32([A-z]{1,})^32([0-9]{4})^13"
        .replacement.text = "<PUD>Received \1 \2 \3^lRevised \4 \5 \6^l"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Call Macro3
End Sub
Sub Macro3()
    Selection.Find.ClearFormatting
    Selection.Find.replacement.ClearFormatting
    Selection.Find.replacement.Highlight = True
    With Selection.Find.replacement.ParagraphFormat
        .SpaceBeforeAuto = False
        .SpaceAfterAuto = False
        .Alignment = wdAlignParagraphCenter
    End With
    With Selection.Find
        .text = "^lAccepted^32([0-9]{1,2})^32([A-z]{1,})^32([0-9]{4})^13"
        .replacement.text = "^lAccepted \1 \2 \3^lPublished"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Sub Macro4()
    Selection.Find.ClearFormatting
    Selection.Find.replacement.ClearFormatting
    Selection.Find.replacement.Highlight = True
    With Selection.Find.replacement.ParagraphFormat
        .SpaceBeforeAuto = False
        .SpaceAfterAuto = False
        .Alignment = wdAlignParagraphCenter
    End With
    With Selection.Find
        .text = _
            "Received^32([0-9]{1,2})^32([A-z]{1,})^32([0-9]{4})^13Accepted^32([0-9]{1,2})^32([A-z]{1,})^32([0-9]{4})^13"
        .replacement.text = "<PUD>Received \1 \2 \3^lAccepted \4 \5 \6^l"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Call Macro5
End Sub
Sub Macro5()
    Selection.Find.ClearFormatting
    Selection.Find.replacement.ClearFormatting
    Selection.Find.replacement.Highlight = True
    With Selection.Find.replacement.ParagraphFormat
        .SpaceBeforeAuto = False
        .SpaceAfterAuto = False
        .Alignment = wdAlignParagraphCenter
    End With
    With Selection.Find
        .text = "^lAccepted^32([0-9]{1,2})^32([A-z]{1,})^32([0-9]{4})^l"
        .replacement.text = "^lAccepted \1 \2 \3^lPublished^p"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
End Sub

Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
I making too long Help me Shrink to fit long merged name Marcia Mail Merge 8 09-20-2022 06:03 AM
I making too long Help me long list yacov Excel 3 08-03-2021 02:41 AM
Displaying contacts too long escouger Outlook 0 09-28-2016 12:55 PM
I making too long Help me utm to long lat conversion gsrikanth Excel 2 01-17-2012 07:29 AM
I making too long Help me Moving a Long Document clpix Word 1 01-14-2010 08:55 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:07 PM.


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