Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / July 2007

Tip: Looking for answers? Try searching our database.

syntax to retrieve form path

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Sivilla - 01 Sep 2005 18:37 GMT
Is it possible to retrieve the location (ex. URL of sharepoint site) where
the form has been downloaded. I use the same form in many sites, and don't
want to have to go into each form to modify the submit location.

thanks,
Signature

John Sivilla
Developer IT
Montreal, Canada
Blog: http://spaces.msn.com/members/sivilian/

Scott L. Heim [MSFT] - 01 Sep 2005 19:58 GMT
Hi John,

If you have "published" and InfoPath solution (XSN) to Sharepoint and you
want to find out the Sharepoint library/XSN that a form in that library is
bound to, you can use the following code:

XDocument.Solution.URI

As an example, if I published a form to: http://server/site/myFolder
executing the above line of code would return:

http://server/site/myFolder/Forms/template.xsn

Obviously, if you did not need the information all the way to the XSN you
could parse the returned path to get what you want.

I hope this helps!

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights
John Sivilla - 01 Sep 2005 21:25 GMT
thanks for the response. But with the limited string functions from xpath and
xslt, how would the parse code look like?

thanks,

Signature

John Sivilla
Developer IT
Montreal, Canada
Blog: http://spaces.msn.com/members/sivilian/

> Hi John,
>
[quoted text clipped - 18 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights
Scott L. Heim [MSFT] - 01 Sep 2005 21:48 GMT
Hi John,

I was referring to using "script" (i.e. JScript) to get what you need. For
instance, using the same URL sample for publishing your InfoPath template:

http://server/site/myFolder

Executing this script:

var strURI = XDocument.Solution.URI;
var strFormLib = strURI.substr(0, strURI.indexOf("template.xsn"));

Returns:

http://server/site/myFolder/Forms/

Whereas modifying the script to:

var strURI = XDocument.Solution.URI;
var strFormLib = strURI.substr(0, strURI.indexOf("Forms/template.xsn"));

Returns:

http://server/site/myFolder/

Does this help you?

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights
John Sivilla - 01 Sep 2005 22:14 GMT
thanks Scott... Exactly what I was looking for.
Signature

John Sivilla
Developer IT
Montreal, Canada
Blog: http://spaces.msn.com/members/sivilian/

> Hi John,
>
[quoted text clipped - 27 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights
Scott L. Heim [MSFT] - 01 Sep 2005 23:07 GMT
Thanks for letting me know John!

Take care,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights
Paul B - 20 Jul 2007 17:08 GMT
Do you have a way of doing this in IF 2007. I need the address of the site
the form is loaded not the location of the form template.

Thanks in advance

Paul
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.