HTTPostedFile & Word Automation

  • Thread starter Thread starter Donald Nova
  • Start date Start date
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
 
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
 
Back
Top