Hi ALL
I have a word document with some Mail merge Fields connected to the datasource(a text file).
some Mergefield's values are actullay the path of some other word document in a subfolder.
the mergefields starting with the "Inc" are those fields.


I need to write a macro that get the path from such field.value and get the content and update the Field with the text of this word doc.



In my Main Document there are some Fields one of them is <<Inc_ABC >>

Public Sub GetTheText()
Dim strFilename As String
For Each afield In ActiveDocument.MailMerge.DataSource.DataFields

If InStr(1, afield.Name, "Inc", 1) Then

If afield.Value <> "" Then
Set wDoc = Documents.Open(afield.Value)
Set rng = wDoc.Content
ThisDocument.Content = rng
wDoc.Close
End If
End If
Next afield


End Sub

in My Datasource text file there are following entries:
"Inc_ABC"; (The MergeField itself)

"E:\work\SubDocuments\supplier-01.doc";(The Value of Merge Field)



I want to get the Text from the word file stored in the above path and update the merge field with the text.
I tried to do this with the above macro but i dont really know how to update the Merge field in MAcro with the text.


So the Filepath I will get on the fly and i have to update the correspoding field with the content given in the word doc saved in th path.



Please help me out