PDA

View Full Version : Solved: Word-Userform-Applying Bullets-bookmarks



hemishp
11-25-2007, 04:25 AM
Hi folks,

I am creating a userform which automates a word template. Being new to vba i am finding trouble in applying bullets to some of the lines which get inserted after selecting one of options. The case is that depending upon the requirement the user has to select one option from two Choices. If the user selects additional insured option only a line gets inserted in word document (which needs to in bullet form). If the user selects Mortgage clause then three separate sentences get inserted which needs to be in bullet form. In the latter case i am only apply bullet for the first line the rest of the lines are not in bullet form? can some please help me with this? appreciate you asistance. Please see below the macro i wrote

Private Sub cmdOK_Click()
Dim strMortgageClause As String
If optAdditionalInsured = True Then strMortgageClause = "Mortgagee must be named as Additional Insured on Liability"
If optMLP = True Then strMortgageClause = "Specify if Terrorism coverage is included/excluded" & vbCrLf & "Business Income Coverage is required- Specify amount and time element" & vbCrLf & "Mortgagee must be named as Mortgagee & Loss Payee on Property and as Additional Insured on Liability"
Application.ScreenUpdating = False
ActiveDocument.Bookmarks("MortgageClause").Range.Text = strMortgageClause
ActiveDocument.Bookmarks("MortgageClause").Range.ListFormat.ApplyBulletDefault
Application.ScreenUpdating = True
Unload frmbullet
End Sub

TonyJollans
11-25-2007, 05:46 AM
There's quite a bit I could say, but I don't understand how you get any bullets at all as putting the text in the bookmark range removes the bookmark. Try this to begin with to get over the basic problem ..

With ActiveDocument.Bookmarks("MortgageClause").Range
.Text = strMortgageClause
.ListFormat.ApplyBulletDefault
End With

hemishp
11-25-2007, 08:32 AM
There's quite a bit I could say, but I don't understand how you get any bullets at all as putting the text in the bookmark range removes the bookmark. Try this to begin with to get over the basic problem ..

With ActiveDocument.Bookmarks("MortgageClause").Range
.Text = strMortgageClause
.ListFormat.ApplyBulletDefault
End With


Thanks a lot Tony for you prompt assistance. It worked!!!