#1
|
|||
|
|||
Delete first three characters after auto numbering
I'm saving some outlines from the web which are PDFs. Once I save them in Word and apply a auto numbered outline, I get the following results.
1. 1. Marveled (v. 13a). 2. 2. Realized that Peter and John had been with Jesus (v. 13b). 3. 3. Admitted that a miracle had been performed (vv. 14-16). 4. 4. Threatened Peter and John (vv. 17-22). a) a. Commanded them not to speak in the name of Jesus (vv. 17-18). b) b. Peter and John said they could not but speak...(vv. 19-20). c) c. Let them go after more threats (vv. 21-22). How can I remove the first three characters after the auto numbering and get the results below? 1. Marveled (v. 13a). 2. Realized that Peter and John had been with Jesus (v. 13b). 3. Admitted that a miracle had been performed (vv. 14-16). 4. Threatened Peter and John (vv. 17-22). a) Commanded them not to speak in the name of Jesus (vv. 17-18). b) Peter and John said they could not but speak...(vv. 1920). c) Let them go after more threats (vv. 21-22). |
#2
|
||||
|
||||
Maybe with the macro
Code:
Sub macro1() Dim orng As Range Dim opara As Paragraph For Each opara In ActiveDocument.Paragraphs If opara.Style Like "List*" Then Set orng = opara.Range orng.Collapse 1 orng.MoveEndUntil Chr(32) orng.End = orng.End + 1 orng.Text = "" End If Next opara lbl_Exit: Set opara = Nothing Set orng = Nothing Exit Sub End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
Thank you Graham. Works great.
|
#4
|
|||
|
|||
Hi Graham,
How can I modify this to work on a selected group of paragraphs? |
#5
|
||||
|
||||
Set a range to the selection and process the paragraphs in the range e.g.
Code:
Sub Macro2() Dim oPara As Paragraph Dim oRng As Range, oSel As Range Set oSel = Selection.Range For Each oPara In oSel.Paragraphs If oPara.Style Like "List*" Then Set oRng = oPara.Range oRng.Collapse 1 oRng.MoveEndUntil Chr(32) oRng.End = oRng.End + 1 oRng.Text = "" End If Next oPara lbl_Exit: Set oPara = Nothing Set oRng = Nothing Set oSel = Nothing Exit Sub End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#6
|
|||
|
|||
Thanks again Graham. Works great.
|
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Delete certain characters from a line | Helend269 | Word VBA | 5 | 01-09-2018 12:08 PM |
Auto numbering macro | desireemm1 | Word | 1 | 12-10-2015 07:50 PM |
How do I delete strange characters from a document. | Stokkers | Word | 1 | 06-12-2013 04:21 AM |
auto page numbering | socomfort | Word | 2 | 05-28-2012 04:19 PM |
Word VBA: Cannot Edit Range (Delete characters except the first in a table cell) | tinfanide | Word VBA | 3 | 04-27-2012 09:48 AM |