Home > Software engineering >  How to change the format of the first sentence of a paragraph?
How to change the format of the first sentence of a paragraph?

Time:09-17

I want to pass the condition recognition, such as red code section, set up the first sentence in a paragraph format, how to achieve this, a great god, please help, code in the attachment file of macro, great god teach genuflect is begged, thank you,
 

Dim the ib As com.lowagie.text.paragraph
For Each ib ActiveDocument. In Paragraphs
If the ib. Range. Information (wdWithInTable)=False Then
Ib. Range. Select 'selected
Selection. ClearFormatting

If the ib. Range Like "[about]" Then
If the ib. Range. Sentences. Count=1 Then
The ib. Range. Style=wdStyleHeading1
The Else
End the If

ElseIf ib. Range Like [1234567890], "*" Then
If the ib. Range. Sentences. Count=1 Then
The ib. Range. Style=wdStyleHeading2
The Else
End the If

ElseIf ib. Range Like "([1234567890]) *" Then
If the ib. Range. Sentences. Count=1 Then
ib. Range. Style=wdStyleHeading3
The Else
End the If

ElseIf ib. Range Like "[0-9] [,....) * "Then
If the ib. Range. Sentences. Count=1 Then
The ib. Range. Style=wdStyleHeading4
The Else
End the If
ElseIf ib. Range Like "([0-9] *)" Then
If the ib. Range. Sentences. Count=1 Then
The ib. Range. Style=wdStyleHeading5
The Else
End the If
The Else
End the If
End the If
Next

  •  Tags:  
  • VBA
  • Related