Access Local File via Managed Code for Browser Based Form Template

J

JHM4Shot

I have a bit of a problem with one of my browser form templates that I am
developing. Any help is appreciated.

SUMMARY:
I have a form template that has a repeating table. Under the repeating table
is a button labeled "Import from File". When this button is clicked, the user
should be prompted to choose a Word 2007 or Excel 2007 file from his local
hard drive. After selecting the file, my code will run and automatically
populate the repeating table with the contents of the local file.

PROBLEM:
When using managed code for a InfoPath form template, you cannot use the
System.Windows.Forms namespace to access the local file directory. (On the
client side, this works great.)

Is there a way to accomplish what I have set out to do? Can I access the
files of a local hard drive via a browser based form?

Thanks for any help that can be sent my way.
 
S

Sheetal D [MSFT]

When we talk about browser enabled InfoPath forms and your requirement,
looks like we are trying to automate Word/Excel on server which is not
supported.

Attempting to utilize automation of Microsoft Office in an unattended,
non-interactive solution as documented in the following Knowledge Base
article:
257757 INFO: Considerations for Server-Side Automation of Office
http://support.microsoft.com/?id=257757

There are many known complications with server side automation. Microsoft
Office was not designed to accommodate server side automation and,
therefore, it is untested and unsupported. In addition, Office cannot be
changed to run effectively as a server-side component and stay compatible
to its design as an end-user application. We cannot offer software updates,
patches or production code to support or provide a solution for your issue.
You may seek to mitigate the effects of certain problems through your own
code or server configuration, but you will need to fully test and deploy it
at your own risk as you would any custom solution.

Should you choose to continue with a server side solution, we want you to
be aware of the known problems including but not limited to:
Security issues
Reentrancy and scalability
Stability
Upgrade issues
Licensing implications


HTH,
 
S

Sheetal D [MSFT]

To workaround this, you might want to use Word ML or Excel ML files (Open
Office XML format), load the XML file and parse through it to get the
required data into InfoPath form.

Launching Word/Excel from server or automating them from server is not
supported as said in my previous post.

HTH,
Best Regards,
Sheetal, MCSD.NET
Blog: http://sheetal-d.spaces.live.com

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

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