Sub Macro2()
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="IF "
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="MERGESEQ"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.TypeText Text:=" = ""1"" """
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="MERGEFIELD VendorID"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.TypeParagraph
Selection.TypeText Text:="Doc" & vbTab & vbTab & "Pay Date" & vbTab & _
"Pay ID" & vbTab & "Invoice" & vbTab & vbTab & "Payment"" """""
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="SET Vendor1 "
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeParagraph
Selection.TypeText Text:="MERGEFIELD VendorID"
Selection.MoveRight Unit:=wdCharacter, Count:=4
Selection.TypeParagraph
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="IF "
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="Vendor2"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.TypeText Text:=" <> "
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="Vendor1"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.TypeText Text:=""""
Selection.TypeParagraph
Selection.InsertBreak Type:=wdPageBreak
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="MERGEFIELD VendorID"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.TypeParagraph
Selection.TypeText Text:="Doc" & vbTab & vbTab & "Pay Date" & vbTab & _
"Pay ID" & vbTab & "Invoice" & vbTab & vbTab & "Payment"
Selection.TypeParagraph
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="MERGEFIELD DocNo"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.TypeText Text:=vbTab
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="MERGEFIELD PayDate"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.TypeText Text:=vbTab
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="MERGEFIELD PayID"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.TypeText Text:=vbTab
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="MERGEFIELD InvoiceNo"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.TypeText Text:=vbTab
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="MERGEFIELD Payment"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.TypeText Text:=""" """
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="MERGEFIELD DocNo"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.TypeText Text:=vbTab
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="MERGEFIELD PayDate"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.TypeText Text:=vbTab
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="MERGEFIELD PayID"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.TypeText Text:=vbTab
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="MERGEFIELD InvoiceNo"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.TypeText Text:=vbTab
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="MERGEFIELD Payment"
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.TypeText Text:=""""
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="SET "
Selection.TypeText Text:="Vendor2 "
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="MERGEFIELD VendorID"
Selection.MoveRight Unit:=wdCharacter, Count:=4
End Sub