Word 2007 vba, directly select field by name attribute of code property? -


is there way have vba select field in word doc using name attribute of field code property? maybe using pseudo selector?

background: have 8 fields (docproperty name_first, name_last, etc) in document in 4 places (total 32 items)

instead of looping through entire collection of fields, want able return collection of fields match name_first, , make changes,insertafter, etc, call update method on fields only. updating fields causing noticeable delay on each form field when exited next field.

the msdn documentation shows examples using ordinal index numbers, isn't helpful in real world. if changes ordinal position of field, donkeykong!

a bookmark can referenced name. if want update 4 fields reflect name_first, place bookmarks on 4 fields names "name_first_1", "name_first_2" etc. update fields like:

for = 1 4   activedocument.bookmarks("name_first_" & i).range.fields(1).update next 

in words: bookmarked range pseudo selector. field update first field in referenced range.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -