View Single Post
 
Old 04-25-2013, 10:45 PM
fumei fumei is offline Windows 7 64bit Office XP
Expert
 
Join Date: Jan 2013
Posts: 440
fumei is on a distinguished road
Default

I don't know if this helps, but say you have:

FF_Doc_A.doc has x formfields (x = any number)
FF_Doc_B.doc has x formfields

FF_Doc.B formfield names match EXACTLY the names in FF_Doc_A. The results of the formfields in B becomes equal to the results of the identically named formfields in A. For the code below, the ActiveDocument is FF_Doc_A, and FF_Doc_B is open (i.e. in the Documents collection).
Code:
Option Explicit
Sub CopyStuff()
Dim docFF As FormFields
Dim oFF As FormField
Dim strTempName As String
Set docFF = ActiveDocument.FormFields
For Each oFF In docFF
   strTempName = oFF.Name
   Documents("FF_Doc_B.doc").FormFields(strTempName).Result = _
         oFF.Result
Next
End Sub
N.B. to be proper code, the above needs testing for type of formfields. Dropdown fornfields will fail (but the code can be altered to make them work). It works best for text formfields. It is only to give you an idea.
Reply With Quote