J
Josh
I got the code to add a progress bar from the Word MVP website (http://
word.mvps.org/FAQs/Userforms/CreateAProgressBar.htm) but I wanted to
apply it to the awesome code Bear created for me in a previous post.
I was deleting and/or replacing checkboxes in a document. I counted
all the check boxes in my document, there are 273 of them. I inserted
the code into the MVP code and my progress bar actually goes
backwards. I need to know how to declare the number of checkboxes
correctly so the bar will work correctly. Here is what I have.
Option Explicit
Private Sub UserForm_Activate()
Dim i As Integer
ToggleProtectDoc (unlocks document)
Me.Repaint
For i = ActiveDocument.FormFields.Count To 1 Step -1
With ActiveDocument.FormFields(i)
If .Type = wdFieldFormCheckBox Then
If .CheckBox.Value = True Then
.Range = "X"
Else
.Delete
End If
End If
End With
Label1.Width = i / 7
Frame1.Repaint
Next i
Unload Me
End Sub
word.mvps.org/FAQs/Userforms/CreateAProgressBar.htm) but I wanted to
apply it to the awesome code Bear created for me in a previous post.
I was deleting and/or replacing checkboxes in a document. I counted
all the check boxes in my document, there are 273 of them. I inserted
the code into the MVP code and my progress bar actually goes
backwards. I need to know how to declare the number of checkboxes
correctly so the bar will work correctly. Here is what I have.
Option Explicit
Private Sub UserForm_Activate()
Dim i As Integer
ToggleProtectDoc (unlocks document)
Me.Repaint
For i = ActiveDocument.FormFields.Count To 1 Step -1
With ActiveDocument.FormFields(i)
If .Type = wdFieldFormCheckBox Then
If .CheckBox.Value = True Then
.Range = "X"
Else
.Delete
End If
End If
End With
Label1.Width = i / 7
Frame1.Repaint
Next i
Unload Me
End Sub