Getting the path of an InfoPath 2003 Form (XSN) - InfoPath Dev
in

InfoPath Dev

Getting the path of an InfoPath 2003 Form (XSN)

Last post 07-15-2008 03:12 AM by swathip. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 06-16-2008 02:11 AM

    • Magra
    • Not Ranked
    • Joined on 06-16-2008
    • Posts 2

    Getting the path of an InfoPath 2003 Form (XSN)

    How can you get the path an InfoPath 2003 Form (XSN) is saved under in VBScript/JScript? Is there any Property like ThisWorkbook.Path or DB.Name in MS Access/VBA.

    My setup is as follows: In a local folder I have one InfoPath Form (XSN file) and 4 PDF files. The form contains 4 buttons which must open one of the PDFs when clicked on. I wrote a code for this which works fine with the PDF filepaths hardcoded. But as soon as I move the form and the PDFs to another folder, this won't work anymore.

    So I would prefer to build up the PDF filepaths in the code, based on the folder where my form lies. But I found no way how to get this folder in the code.

    All I was able to get is the network folder where the original of my form is stored and published. But as the form is mostly used offline this doesn't really help me.

  • 06-19-2008 02:53 PM In reply to

    Re: Getting the path of an InfoPath 2003 Form (XSN)

    You can get the path using XDocument.URI using VBScript. I've used it to pass the information to a field in the form.

    Example:

    strPath = XDocument.URI

    dim oInfo
    set oInfo = XDocument.DOM.selectSingleNode("//my:FormPath")
    oInfo.text = strPath

  • 07-15-2008 01:51 AM In reply to

    • Magra
    • Not Ranked
    • Joined on 06-16-2008
    • Posts 2

    Re: Getting the path of an InfoPath 2003 Form (XSN)

    No, that doesn't work. When using XDocument.URI I get back "Form1" instead of something like "C:\Program Files\CRM\Files\Test.xsn" :-(

  • 07-15-2008 03:12 AM In reply to

    Re: Getting the path of an InfoPath 2003 Form (XSN)

    Hi,

    Use the following code in JScript to get the path of an InfoPath xsn.

    var solutionURI =   XDocument.Solution.URI

    Hope this hepls you.
    Swathip
    www.ggktech.com
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.