Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim oStartHeadingParagraph As Paragraph
- Set oStartHeadingParagraph = Selection.Paragraphs(1)
- If oStartHeadingParagraph.Style <> "Heading 1" Then
- MsgBox "Please select the Heading 1 paragraph for the section you want to delete."
- Else
- Dim oParagraph As Paragraph
- Set oParagraph = oStartHeadingParagraph
- Do While Not oStartHeadingParagraph.Next Is Nothing
- If oStartHeadingParagraph.Next.Style = "Heading 1" Then
- Exit Do
- Else
- oStartHeadingParagraph.Next.Range.Delete
- End If
- Loop
- oStartHeadingParagraph.Range.Delete
- End If
Add Comment
Please, Sign In to add comment