How to find bullet and format lists (VBA _ Word Documnet)

I am trying to find instances of a bullet list in a document, and then change the bullet type and bullet size.

I tried to change the following style code so that it uses a bullet type that is formatted for the size and type of bullet I want, but I cannot imagine the right object to call or the right properties for the assignment.

I added a custom marker type and size to the marker list, which is at position 9 (9) of the list, if that helps.

I tried changing the “paragraph list” to a bullet type, but kept the error.

Sub BulletStyle ()
Dim oBull As Word.Paragraph

For Each oBull In ActiveDocument.Paragraphs
   If oBull.Range.ListFormat.ListType = _
         WdListType.wdListBullet Then
      oBull.Style = "List Paragraph"
   End If
Next
End Sub
+4
source share
1 answer

, , , , "".

oBull.Style = "List Paragraph"

:

oBull.Style = "MyCustomStyle"

, .

enter image description here

+3

Source: https://habr.com/ru/post/1536115/


All Articles