On Jul 28, 6:55*pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
> On Mon, 28 Jul 2008 02:42:12 -0700,NitinMahajan<nitinhung...@gmail.com> *
> wrote:
>
> > I dont think it will work because I'm currently using .net 1.1 and
> > they way the word object can be created is creating a word document
> > from a file stream and then using that word doc.
>
> Well, that's not the question you asked. *_Creating_ the Word document,as *
> you asked, can be done just as has been suggested. *But yes, if you want *
> to _use_ the document in Word, you need some way of getting that data to *
> Word. *Unfortunately, as far as I know Word offers no memory-based API to *
> load a document. *It has to come from a file. *And I'm not aware of any *
> API that would virtualize a block of memory as a file per se.
>
> You might want to look at the unmanaged Windows API, and see if the *
> memory-mapped file i/o might suit your purposes. *You'd have to use *
> p/invoke in order to write to the memory-mapped file object. *I don't *
> recall off the top of my head whether you can create a memory-mapped file*
> that is backed only by the swap-file, but if you can that might do what *
> you want.
>
> Personally, I think you're probably overthinking the problem. *Creatinga *
> temporary file and letting Word read it seems like a fine solution to me.*
> It's the exact model used by all sorts of other programs (including email*
> programs opening file attachments).
>
> Pete
I guess you are right. I was just checking if there are other ways to
achieve this...
In any case thanks a lot your help.
|