M
Martin Cameron
I have a word document with approx 20 bookmarks in it. I have a UserForm that
populates those bookmarks. I would like the code to be generic but am having
a problem - the following code returns an error "Invalid Qualifier" with
reference to the textBox field name. I would really appreciate somehelp on
this
<code>
Dim Bmk() As String
Dim y As Integer, J As Integer
Dim txtFieldName As String
y = ActiveDocument.Bookmarks.Count
ReDim iniarray(y)
For J = 1 To y
Bmk(J) = ActiveDocument.Bookmarks(J).Name
Trim(txtFieldName) = CStr(Bmk(J))
ActiveDocument.Bookmarks(Bmk(J)).Range.Text = txtFieldName.Text
Next J
</code>
populates those bookmarks. I would like the code to be generic but am having
a problem - the following code returns an error "Invalid Qualifier" with
reference to the textBox field name. I would really appreciate somehelp on
this
<code>
Dim Bmk() As String
Dim y As Integer, J As Integer
Dim txtFieldName As String
y = ActiveDocument.Bookmarks.Count
ReDim iniarray(y)
For J = 1 To y
Bmk(J) = ActiveDocument.Bookmarks(J).Name
Trim(txtFieldName) = CStr(Bmk(J))
ActiveDocument.Bookmarks(Bmk(J)).Range.Text = txtFieldName.Text
Next J
</code>