I am trying to use vbscript to generate an email based on the data collected from a form. This email is text only and needs to read the information from a repeating table popluated by a user (hostname and IP address).
I've been able to figure out how to read the first row... but the for loop I thought would work doesn't increment for me. I'm a noob to both infopath and vbscript, so I'm hoping someone can help me out....
Here's the code:
Dim oLastRow
dim a
a = 0
dim b
b = XDocument.DOM.selectSingleNode("//my:countrules").Text 'hidden field to get the number of rows in the table
for a = 1 to b+1
Set oLastRow = XDocument.DOM.selectNodes("//my:myFields/my:Addrulegroup/my:addrulegroup/my:addruletable[a]")
src = XDocument.DOM.selectSingleNode("//my:srcname").Text
srcaddr = XDocument.DOM.selectSingleNode("//my:addsrc").Text
rowdata = src & " " & srcaddr & vbcrlf
psbody = psbody & rowdata 'appends the row to the body of the email
a = a + 1 'increments my counter (a)
next
Maybe someone knows a better way... thanks in advance for the help.