HTTPostedFile & Word Automation

D

Donald Nova

I am building a system that allows a user to upload a MS Word file, using a
HtmlInputFile control, and by using
HTTPPostedFile.SaveAs("c:\uploads\myFile.doc") I can save the Word files to
disk.

I can then do the following to open and analyse the MS Word File from the
harddisk:


Dim myDoc as Word.Document
Dim wdApp As New Word.Application()
Dim pathName As String = "c:\uploads\myFile.doc"
myDoc = wdApp.Documents.Open(FileName:=pathName)
etc etc.....

However, what I really want to do is avoid having to save the file to disk
first.

So the question: Is there a way to open the uploaded HTTPostedFile MS Word
file while it is still in memory?

Any help would be greatly appreciated!

Cheers
Donald
 
B

BruceJohnson

I think you'll find that, because Word Automation hasn't made it into
the .NET work (that is, it's not written in managed code), it will have
a basic lack of understanding (from the interface perspective) of things
like streams. Or, to put it another way, I'm not aware of any method in
Word Automation that allows you to open a file stream instead of a
physical file.

Bruce Johnson
http://www.ObjectSharp.com/Bruce
 

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

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,273
Latest member
DamonShoem

Latest Threads

Top