prepopulate form

F

Franz Demmel

Hi,

I have a form with lots of fields. The people who use it should be able
to open the form, select an existing xml and load it. This xml
prepopulates some of the fields. Then the user should be able to load
another xml, which prepopulates some other fields.
How can this be done the best way. (I found this msdn article:
http://support.microsoft.com/default.aspx?scid=kb;en-us;896451 but to
create a xsl for my form seems a bit complicated)

Best regards,

Franz
 
G

Gaurav Bhardwaj

Hi,

You can program it in C#. Just have a button on the form which when clicked
displays a form to the user. The user can browse and select the XML file
from there. When user dismisses this form, have your logic to parse the XML
file. Then you can update the fields on the form simply using

thisXDocument.DOM.SelectSingleNode("XYZ").nodeTypedValue = YourValue;

Where exactly are you facing problems ?

Thanks,
Gaurav
 
F

Franz Demmel

Gaurav said:
Hi,

You can program it in C#. Just have a button on the form which when clicked
displays a form to the user. The user can browse and select the XML file
from there. When user dismisses this form, have your logic to parse the XML
file. Then you can update the fields on the form simply using

thisXDocument.DOM.SelectSingleNode("XYZ").nodeTypedValue = YourValue;
You're right. I've found an example that's shipped with office 2003
(UIBasic.xsn)
where it is described how to do this with scripting (maybe I'll try c#
after I have
the first results).
The problem I'm facing now are more security related (fully trusted
forms, etc.) But I hope to solve them soon.
 
Top