How can I programmatically save the form to a specified name in vbs script?

C

Caeanis

I have created a button when clicked should save the form to the name
specified in a text box on the form. Following code below:

' Write your code here
Dim xslt
Dim xslDoc
Dim xslProc
Dim objXMLNode
Set objXMLNode = XDocument.DOM.selectSingleNode("/*[local-name()='Recipe'
and
namespace-uri()='http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-10-08T23:36:28']/*[local-name()='Header'
and
namespace-uri()='http://schemas.microsoft.com/office...2005-10-08T23:36:28'][1]/*[local-name()='Name'
and
namespace-uri()='http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-10-08T23:36:28'][1]")
myPath = "C:\Inetpub\wwwroot\Recipes\" & objXMLNode.text & ".xml"
Msgbox "You are about to save the following file: " & objXMLNode.text &
".htm"
XDocument.Save(myPath)

However I get an error message on the following line: XDocument.Save(myPath)

Is there something I'm missing?
 
C

Caeanis

I should mention, that the error I get is access denied. Is this because
the form is signed? Is it because the folder to which I'm saving is
restricted somehow? As admin for both Windows and IIS I doubt that's the
case, but something is preventing me from completing this task.

Is there a better way to go about this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top