
Signature
Marshall Harrison
Microsoft MVP - Office Communications Server
Email: marshall@GotSpeech.Net
Web: www.GotSpeech.Net
Blog: http://gotspeech.net/blogs/marshallharrison/default.aspx
You can create an XML file containing the configuration settings. Add this
file as a resource file to your form template (Tools > Resource Files). Then
create a data connection to the resource file (Tools > Data Connections > Add
> Receive data > XML document > Resource files). You can now access this data
source from within the OnLoad event of your form (search the newsgroup for
code samples). To update your configuration file, go to Tools > Resource
Files, select the file, click on Export, modify it, then add it back again to
your form by replacing the old file.
Another option is to put the configuration file on one location that is
accessible by all users and then not include it in your form template. This
way you can update the configuration settings externally without having to
update the resource file in the form template itself. But again, users must
have access to the location of the config file.
---
S.Y.M. Wong-A-Ton
> We have a form that a contractor developed for us but some of the form
> variables are hard coded. For example the SharePoint URL is hard coded as
[quoted text clipped - 9 lines]
>
> Any suggestion will be appreciated.
Marshall Harrison [OCS MVP] - 24 Jan 2007 13:10 GMT
Thanks for the information.
Two quick questions.
1. If I place the file on the SharePoint server where the form is located
then will it be loaded properly by every user?
2. I assume the path would have to be fully qualified so that when the form
is run on the user's local machine the OnLoad event will find the file. Is
that correct?

Signature
Marshall Harrison
Microsoft MVP - Office Communications Server
Email: marshall@GotSpeech.Net
Web: www.GotSpeech.Net
Blog: http://gotspeech.net/blogs/marshallharrison/default.aspx
> You can create an XML file containing the configuration settings. Add this
> file as a resource file to your form template (Tools > Resource Files).
[quoted text clipped - 36 lines]
>>
>> Any suggestion will be appreciated.
S.Y.M. Wong-A-Ton - 25 Jan 2007 07:51 GMT
1. Theoretically (because I haven't tested it), if every user has access to
the file on SharePoint and SharePoint itself has access to the data source,
then yes. I do not have a proper environment set up to test it for you, so
you'll have to give it a go and see if it works.
2. The path is always fully qualified. If you extract the form files and
search the manifest.xsf for dataObjects, you'll see an xmlFileAdapter with a
fileURL listed; there is where InfoPath gets the path from. You access the
data object by its name and not by its location from within the OnLoad event.
---
S.Y.M. Wong-A-Ton
> Thanks for the information.
>
[quoted text clipped - 46 lines]
> >>
> >> Any suggestion will be appreciated.
Marshall Harrison [OCS MVP] - 25 Jan 2007 18:41 GMT
Thanks.
I'll give all this a try later today.
> 1. Theoretically (because I haven't tested it), if every user has access
> to
[quoted text clipped - 73 lines]
>> >>
>> >> Any suggestion will be appreciated.