Problem using OpenFileDialog in InfoPath

G

Gustaf Liljegren

Here's what I'm trying to do:

The user opens a customized form. There is a button on the form which is
used to import data from a text file, into textboxes on the form. This
text file needs to be read by a special parser I have written in C#. The
output from that parser is an Infopath form (i.e. an XML file with a PI
pointing to this type of form).

When the user click the button, I want an OpenFileDialog to appear. I
got that working, but as soon as I set the InitialDirectory property, I
get an error. I get the message in Swedish. In English, the important
part would be something like:

The request for permission of type
System.Security.Permissions.FileIOPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.

I have been using InitialDirectory before in other .NET projects, so
this error seem to be specific for InfoPath.

Gustaf
 

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