Howto Get DataBuffer(memory) into Word 2

  • Thread starter Jay Chadderwala
  • Start date
J

Jay Chadderwala

hi Jezebel,

thanks for replying

I mean that I have read .doc file programmatically and stored it to
variable
say unsigned char*.

Now i want to open word and in that i want to display content of that
unsinged char* as data.

with same format as original .doc file.

example

file is located on one machine and its name is XYZ.doc

I want to send content of that file to another machine. So i've read
source file and passing string to another machine. My program of
another mchine has buffer UCHAR*. I am able to open WORd thru VBA but
i don't know how to open blank document and its data will that
UCHAR*..
And then dont allow to save thats it.

Waiting for yr response on it.

Thanks

Jay


A little more information would help. What do you mean 'a variable
holds
content of Word documents' ?
 
J

Jay Freedman

Hi Jay,

It isn't going to work. A Word file (or any other Office application
file) isn't a simple text stream -- it's a complex data structure
called an OLE structured storage format. It's full of pointers and
binary values in addition to the text. When Word opens a file, it uses
a large built-in code module to "deserialize" the file's contents and
apply all the formatting and other characteristics that make up a
document. The deserialization module works only with file streams, not
with your memory buffer.

Forget about trying to transfer documents in memory -- just transfer
the file from one machine to the other and then open it normally.
 
J

JayChadderwala

Hello Mr.Jay


Thanks for giveing detailed reason.

If I want to read in OLE structured storage format then what i will have to
do?

The deserialization module works only with file streams, not with your
memory buffer.? How to implement THIS.?

Any Starting hints/links will be helpful.

As i can change the way i read original word document.

Thanks Once Again.

Jay
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?SmF5Q2hhZGRlcndhbGE=?=,

Which version of Word would you be working with? The only way I know of to
transfer such information *without* creating a file on disk is to pass it as
WordProcessingML. But would only work with Word 2003 as the target version of
Word.
Thanks for giveing detailed reason.

If I want to read in OLE structured storage format then what i will have to
do?

The deserialization module works only with file streams, not with your
memory buffer.? How to implement THIS.?

Any Starting hints/links will be helpful.

As i can change the way i read original word document.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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