Is there any way to display the form's version?

M

MatsonPP

Just curious if I would be able to display the form's version somewhere
in the form. I know I can just go get it from the form options advanced
tab, but it would be so cool if I could have a field that auto updated
with the form's version.

Lemme know,
Thanks,
Matt
 
S

Scott L. Heim [MSFT]

Hi Matt,

Here are some sample steps that should get you what you need:

- Open your InfoPath solution in Design View
- Add a new text box to your form named: txtVersion
- From the Tools menu choose Programming and then select On Load Event
- Add the following code to that event:

- VBScript:

Dim objVersion
Set objVersion =
XDocument.DOM.selectSingleNode("//my:myFields/my:txtVersion")
objVersion.text = XDocument.Solution.Version

- JScript:

var objVersion =
XDocument.DOM.selectSingleNode("//my:myFields/my:txtVersion");
objVersion.text = XDocument.Solution.Version;

- Save the code, solution and then test

I hope this helps!

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Top