Saving form by JS code

V

vb6dev2003

Hi,

I have a very simple form with 1 text box and 1 button. I can open the form
enter a text and use "Save As" in the File menu to save my form as test.xml.

Now my button has the following code:
XDocument.SaveAs("C:\test.xml");

I can't save the form using the above code, I get a "permission denied"
error from InfoPath.

I am an admin on my machine and if I can use the Save As menu, I should be
able to duplicate the same thing by code???

Any idea.

Thanks,

vbdev
 
H

Harald Dunkel

vb6dev2003 said:
Hi,

I have a very simple form with 1 text box and 1 button. I can open the form
enter a text and use "Save As" in the File menu to save my form as test.xml.

Now my button has the following code:
XDocument.SaveAs("C:\test.xml");

I can't save the form using the above code, I get a "permission denied"
error from InfoPath.

I am an admin on my machine and if I can use the Save As menu, I should be
able to duplicate the same thing by code???

Any idea.

Thanks,

vbdev

Hello,
the form must be fully trusted - you have to install it. Create a .msi
File with the tool "regform" from the SDK.

Harald
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top