View Single Post
 
Old 05-24-2022, 09:06 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Windows 10 Office 2019
Competent Performer
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 190
Cendrinne is on a distinguished road
Lightbulb Need Help, If Paragraph Mark is Color Red, then Delete

Hello Pros,

I have a bloc of texte/paragraph, where my bullets are splitted in two sentences, due to PDF converted in Word.
Note: The bullet spitted in two sentences is that the top has a bullet, the other splitted sentence doesn't have the bullet. I hope it's clear. By the way, it's easy to see since they both (line 1) end and start (line 2) with lower case letter.

I found ways to fix the issue, but it only does it for one.

I've tried 15 different ways, I'm giving up to your expertise.
****
I do a regular Find and Replace, by selecting the top bulleted sentence that are split in two, so Find ^p, then turn them into Red Color AND add a space before the paragraph mark.
So if we go to the end of line, then click on the Delete button, it deletes the red paragraph mark, without loosing the bullet.

1 step:
Code:
    Selection.Find.ClearFormatting
    Selection.Find.Font.Color = wdColorRed
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "^p"
        .Replacement.Text = " ^&"
        .Forward = True
        .Wrap = wdFindStop
        .Format = True
        .MatchCase = True
        .MatchWildcards = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
*************************
Step 2
Code:
    With Selection.Find
      .Font.ColorIndex = wdRed
      .Execute FindText:="^p", Format:=True, Forward:=True
      If Format(.found = True) Then
        Selection.EndKey Unit:=wdLine
        Selection.Delete
       
   Do While found = True
    .Execute Replace:=wdReplaceAll
    
    Loop
      End If
    End With
What I wish to accomplish, is to keep the bullet, but merge two splited sentences.

Any insights? It's driving me mad and don't want to do one at the time.
Just to select a block of problem area.

Cause my different ways, either I have error message or it does one at the time.

I would be soooo appreciative for any help towards this problem.

Cendrinne

Last edited by Cendrinne; 05-25-2022 at 06:36 PM.
Reply With Quote