D
Diane
I need to create a find/replace function that will allow me to replace the
bookmark name in the "INCLUDE TEXT" field. I've searched this site and found
an example that I'm working with, as I debug this, I see that "afield" has
the data that I need to change, all I really want to do is search for AUGUST
in the field and replace with SEPTEMBER, I can't seem to get that to work for
me, instead, I decided to search on the complete fieldcode, although I'm
getting a compiler error on my "afield.code like" statement.
Can anyone see what I'm doing wrong with this??
Dim afield As field
With ActiveDocument
For Each afield In .Fields
If afield.code = "INCLUDETEXT "\\\\NETWORK
SERVER\\dirNAME\\DIRECTORY2\\msword.doc " AUGUST" Then
afield.Select
Selection.Range.Text = "INCLUDETEXT "\\\\NETWORK
SERVER\\dirNAME\\DIRECTORY2\\msword.doc" SEPTEMBER"
End If
Next afield
End With
bookmark name in the "INCLUDE TEXT" field. I've searched this site and found
an example that I'm working with, as I debug this, I see that "afield" has
the data that I need to change, all I really want to do is search for AUGUST
in the field and replace with SEPTEMBER, I can't seem to get that to work for
me, instead, I decided to search on the complete fieldcode, although I'm
getting a compiler error on my "afield.code like" statement.
Can anyone see what I'm doing wrong with this??
Dim afield As field
With ActiveDocument
For Each afield In .Fields
If afield.code = "INCLUDETEXT "\\\\NETWORK
SERVER\\dirNAME\\DIRECTORY2\\msword.doc " AUGUST" Then
afield.Select
Selection.Range.Text = "INCLUDETEXT "\\\\NETWORK
SERVER\\dirNAME\\DIRECTORY2\\msword.doc" SEPTEMBER"
End If
Next afield
End With