All,
Still a little new to programming in InfoPath. I am trying to pull data from a repeating section. I have done this successfully from a repeating table but when I try to do this from a repeating section, it fails saying:
The following error occurred:
Object required: 'oItem.selectSingleNode(...)'
File:script.vbs
Line:302
What do I need to change to get this to work for a repeating section instead of a repeating table? My code says:
Dim firstname, lastname, unit
Dim objXMLNodes, oItem
Dim Outlook ' As New Outlook.Application
Dim Message ' As Outlook.MailItem
set objXMLNodes = XDocument.DOM.selectNodes("//my:RecipientInfoRepeat") '-- RecipientInfoRepeat
if objXMLNodes.length <= 0 then
XDocument.UI.Alert("Please Add at leaste One (1) recipient to form before submitting.")
exit sub
end if
If objXMLNodes.length > 0 Then
For Each oItem In objXMLNodes
recipientid = oItem.selectSingleNode("my:LogonID").text
firstname = oItem.selectSingleNode("my:FirstName").text
lastname = oItem.selectSingleNode("my:LastName").text
employeetype = oItem.selectSingleNode("my:NonEmployee").text
location = oItem.selectSingleNode("my:Location").text
jobfunction = oItem.selectSingleNode("my:JobFunction").text
emailmessage = emailmessage + classaction + " Recipient --" + recipientid + "--" + lastname + "," & _ + firstname + "--" + employeetype + "--" + location + "--" + jobfunction + cr
next End If