Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15729

VS 2019 Word - Bullet List Formatting

$
0
0
I have the following code that works great for inserting a list of bullet points. (Inserting strings and making them bullets.)

My only issue and for the life of me cant figure it out is, the last bullet, just the bullet not the text is at 12pt, when it should be 10pt. No matter how I try to insert or format I cant get the bullet point to be 10pt.

I have tried InsertBefore, I end up with extra bullet point. I have tried changing when/where the formatting happens, no luck. Any ideas?

Code:


    Private Sub CreateBullets(ByVal reportInfo As ReportInformation)

        Try

            Dim bulletList As String() = reportInfo.BulletPoints.ToArray()

            wrdBulletRange = wrdDocument.Bookmarks("StartBullets").Range
            wrdBulletRange.Select()
            wrdBulletRange.ListFormat.ApplyBulletDefault()

            For i As Integer = 0 To bulletList.Length - 1

                Dim bulletItem As String = bulletList(i)

                If i < bulletList.Length - 1 Then bulletItem &= vbLf

                wrdBulletRange.InsertAfter(bulletItem)

            Next

            wrdBulletRange.Font.Name = "Arial"
            wrdBulletRange.Font.Size = 10

        Catch ex As Exception

            MessageServices.DisplayError("Error", ex)

        End Try

    End Sub

Name:  Bullet.png
Views: 60
Size:  22.3 KB
Attached Images
 

Viewing all articles
Browse latest Browse all 15729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>