![]() |
|
|
|
#1
|
||||
|
||||
|
Based on your description, the following macro shoudl do the job. Test it on a copy of the document: Code:
Option Explicit
Sub DeleteBoldSentences()
Dim oSentence As Range
For Each oSentence In ActiveDocument.Range.Sentences
If Not IsInteger(Asc(oSentence.Characters(1))) Then
Do While oSentence.Characters.Last = Chr(13)
oSentence.End = oSentence.End - 1
Loop
If oSentence.Characters(1).Font.Bold Then oSentence.Delete
End If
Next oSentence
lbl_Exit:
Set oSentence = Nothing
Exit Sub
End Sub
Private Function IsInteger(ByVal i As String) As Boolean
Select Case i
Case 48 To 57
IsInteger = True
Case Else
IsInteger = False
End Select
lbl_Exit:
Exit Function
End Function
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
How can select from a specific character to another character
|
mohsen.amiri | Word | 2 | 02-19-2015 11:38 PM |
Not Bold text but it comes up bold
|
Pluviophile | Word | 7 | 10-22-2013 10:29 AM |
| Format Bold in one line makes all lines bold | Nitte | Word | 2 | 02-07-2013 12:34 AM |
cannot check/uncheck check box but added check box
|
learn2office | Word | 1 | 11-27-2012 02:02 AM |
Using replace to make a word bold and its proceeding character.
|
bostonboi | Word | 1 | 01-16-2011 01:54 PM |