View Single Post
 
Old 01-08-2014, 01:59 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Here's a simple demo of how you can loop through a specified set of formfields:
Code:
Sub Demo()
Dim StrFlds As String, i As Long
StrFlds = "FmFld1,FmFld2,FmFld3"
With ActiveDocument.Range
  For i = 0 To UBound(Split(StrFlds, ","))
    MsgBox .FormFields(Split(StrFlds, ",")(i)).Result
  Next
End With
End Sub
Simply change "FmFld1,FmFld2,FmFld3" to whatever formfield names you use, in the order in which you want to extract them.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote