The below macro will input the field heading followed by the field value. The If statement should check the value of the field and if its greater than 30 the actual value is given, otherwise a zero.
Instead of the value appearing if it's true, I just get the actual text I've typed, not it's value.
Sub Macro1()
Dim doc As Word.Document
Dim dtField As Word.MailMergeDataField
Dim sFieldName As String
Dim sFieldActualName As String
Dim j As Integer
Set doc = ActiveDocument
j = 1
For Each dtField In doc.MailMerge.DataSource.DataFields
sFieldActualName = doc.MailMerge.DataSource.FieldNames(j).Name
sFieldName = dtField.Name
Selection.TypeText Text:=sFieldActualName + ": "
'---------------------------------------------------------------------------
doc.MailMerge.Fields.AddIf Range:=Selection.Range, MergeField:= _
sFieldName, Comparison:=wdMergeIfGreaterThan,_
CompareTo:="30", TrueText:="{MERGEFIELD sFieldName}", _
FalseText:="0"
'---------------------------------------------------------------------------
Selection.TypeParagraph
j = j + 1
Next
End Sub
Please let me know if i need to clarify anything.
Edit: Sample data I'm using from excel
one two three four five
85 50 63 50 41
52 10 84 10 15
85 25 63 35 10