Send form to a shared folder on network - InfoPath Dev
in

InfoPath Dev

Send form to a shared folder on network

Last post 10-23-2019 03:18 AM by khl151. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 02-01-2007 10:05 AM

    Send form to a shared folder on network

    Is there a way to send a form that has been filled out to a shared folder on a network using a submit button? After the form is already filled out I want to send the form to a folder on my companies network for archiving.

    Thanks for any ideas!
  • 02-01-2007 11:14 AM In reply to

    • dpsavy
    • Not Ranked
    • Joined on 01-26-2007
    • USA
    • Posts 13

    Re: Send form to a shared folder on network

    Hello JL,

    Simple enough attach this code to the ONClick event of your submit button. Just set the txtPath to your shared folder, I would reccomend you use a unc path (i.e \\server\share\) rather than a mapped drive letter (i.e S:\share) this make it much more effiecent. I know at my command everyone's "S" drive is mapped differently but using a unc path ensures they get there. After that set the txtFile to a filename or maybe even a field in your form and your set.


    Dim txtPath
    Dim txtName

    txtPath = "Path to your shared folder"
    txtName = "Name of your file"

    XDocument.SaveAS(txtPath & txtName)


    Hope this Helps.
  • 02-02-2007 07:51 AM In reply to

    Re: Send form to a shared folder on network

    Thank you SO much dpsavy! This worked like a charm!
  • 02-07-2007 02:29 PM In reply to

    Re: Send form to a shared folder on network

    I spoke too soon dpsavy! I get an error with the first dim statement. Here exactly what I typed:

    Dim txtPath
    Dim txtName

    txtPath = "T:\Shared Folder\Emp InfoPath Forms"
    txtName = "Employee.xml"

    XDocument.SaveAS(txtPath & txtName)

    Can you see what I might be doing wrong?

    Thanks for any help!
  • 02-08-2007 12:03 AM In reply to

    Re: Send form to a shared folder on network

    Hi,

    Please give the error text you got for the first Dim statement.

    Thanks.
    K.Ramana Reddy / http://www.ggktech.com
    India.
  • 02-08-2007 05:33 AM In reply to

    Re: Send form to a shared folder on network

    The error message was this:
    "InfoPath cannot create a new, blank form.
    The form template is not valid."

    Then when I show details in the error message box, it says the following:

    "InfoPath cannot open the selected form because of an error in the form's code.
    The following error occurred:

    Expected ';'
    File:script.js
    Line:24
    Dim txtPath"

    Thanks!
  • 02-12-2007 10:47 AM In reply to

    Re: Send form to a shared folder on network

    Your form is using JScript for its codebehind but the sample was given in VBScript. You'll have to either convert your form or the sample, which depends on how comfortable you are with either language.

    To convert the form, go to Tools -> Form Options -> Advanced -> Form code language = VBScript
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 02-15-2007 01:41 PM In reply to

    Re: Send form to a shared folder on network

    Thanks for replying Matt! I did what you suggested but now I'm getting the following error:
    The following error occurred:

    Object required: 'Template1'
    File:script.vbs
    Line:25


    Does the code look correct? Thanks for your help!
  • 02-16-2007 05:05 AM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Send form to a shared folder on network

    Hi JL,

    You have to change your folder path as below and try to save the file. Once again check below folder path is available or not in your system.

    txtPath = "T:\Shared Folder\Emp InfoPath Forms\"
  • 10-14-2010 11:49 AM In reply to

    Re: Send form to a shared folder on network

    Hi All,

     

    I am trying same thing but I am trying to do a concat on the filename and have not been able to do so. can I get a little help?

     

    Dim txtPath

    Dim txtName

    txtPath = "file://PHSORNT152/Laboratory/Lab/Client Services/Message Manager/1 Time Orders/"

    txtName = "fieldnames"<---can't seem to get the concat to work with my fields in infopath.

    XDocument.SaveAS(txtPath & txtName)

  • 10-23-2019 03:18 AM In reply to

    • khl151
    • Not Ranked
    • Joined on 06-03-2013
    • Posts 2

    Re: Send form to a shared folder on network

     hi all,

    do you all have the final answer on this? 

     Thank you. 

Page 1 of 1 (11 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.