how do I save a form on disk using submit button

  • Thread starter Lazy thicko needs to know...
  • Start date
L

Lazy thicko needs to know...

I want to create a file of completed forms. Each form is to be stored locally
(on C:) using C:path\(data from form) as a filename.
 
F

Franck Dauché

Hi,

Try to use:
thisApplication.ActiveWindow.XDocument.SaveAs(YourPath);
where YourPath is C:path\filename

Regards,

Franck Dauché
 
C

Caeanis

I am trying this with the following code, but I get an run-time error message
when I attempt to use it: "The form does not have a file name". The xpath
query although long does work, the messagebox returns the right value for
that node, and I have also tried using the save method instead of the saveas
method. Both generate errors.

Dim myPath, 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\" & objXMLNode.text & ".xml"
Msgbox "You are about to save the following file: " & objXMLNode.text &
".xml"
XDocument.SaveAs(myPath)
 

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