I am trying to set up an InfoPath template that will automatically name a form, and place it in a specific network folder. I was able to get this to work without using fields to name the file, but now that I am trying to use the fields I am getting an error that reads: 'Object Required: thisXDocument', File: script.vbs Line: 31. I have three fields that affect the name and placement of the file. The goal is to direct InfoPath to a folder, and then have it within that folder create a folder with the Product Name, and then another folder that would be the Product Number Revision - Serial Number. Then the file name would have the same title as that folder.
Here is the code I wrote:
Dim txtpart
Dim txtrev
Dim txtserial
Dim txtPath
Dim txtDash
Dim txtSlash
Dim txtext
txtpart = thisXDocument.DOM.selectSingleNode("//my:myfields/my:PartNumber").text
txtrev = thisXDocument.DOM.selectSingleNode("//my:myfields/my:Rev").text
txtserial = thisXDocument.DOM.selectSingleNote("//my:myfields/my:SerialNumber").text
txtPath = "\\seusefnpgra001\public\First Time Builds\"
txtDash = "-"
txtSlash = "\"
txtext = ".xml"
XDocument.SaveAs(txtPath & txtpart & txtSlash & txtpath & txtrev & txtDash & txtserial & txtSlash & txtpart & txtrev & txtDash & txtserial & txtext)
Does anyone see what I am doing wrong?
The form security has been set to full access.