remote documents

O

offa23

hi all
ive got a winform that displays a list of word documents that are
stored on a remote
server. when he clicks an item on the list, the requested document
should open (as a read only) so he can view it. to access the remote
documents i had to create a web service (for securiry issues) and he
"send" the document to the client machine.
i "read" the remote document with a FileStream object as bytes[] and
send it to the client. can i open the word document in the client
machine from the
bytes array without saving it to the harddisk or i have to save
it and then open it from there. in any case how
can i do it?
thanks
 
C

Cindy M.

ive got a winform that displays a list of word documents that are
stored on a remote
server. when he clicks an item on the list, the requested document
should open (as a read only) so he can view it. to access the remote
documents i had to create a web service (for securiry issues) and he
"send" the document to the client machine.
i "read" the remote document with a FileStream object as bytes[] and
send it to the client. can i open the word document in the client
machine from the
bytes array without saving it to the harddisk or i have to save
it and then open it from there. in any case how
can i do it?
Word doesn't support any kind of "streaming" of its binary document
file format. IF you're supporting Word 2003 AND the document is stored
on the server in the Word 2003 WordProcessingML file format, then you
can insert it into an existing (empty) Word document using the
.InsertXML method. That's the closest you can get.

For anything else, you have no choice but to save to disk and open from
there.

If the files have to be Read-Only, then I recommend you consider a very
different route, such as generating HTML files to be viewed in a
browser, or generating PDF files. Word is NOT designed to be a
"viewer"; you can't securely present content ONLY for viewing in the
manner you describe.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
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 :)
 
O

offa23

Cindy M. כתב:
ive got a winform that displays a list of word documents that are
stored on a remote
server. when he clicks an item on the list, the requested document
should open (as a read only) so he can view it. to access the remote
documents i had to create a web service (for securiry issues) and he
"send" the document to the client machine.
i "read" the remote document with a FileStream object as bytes[] and
send it to the client. can i open the word document in the client
machine from the
bytes array without saving it to the harddisk or i have to save
it and then open it from there. in any case how
can i do it?
Word doesn't support any kind of "streaming" of its binary document
file format. IF you're supporting Word 2003 AND the document is stored
on the server in the Word 2003 WordProcessingML file format, then you
can insert it into an existing (empty) Word document using the
.InsertXML method. That's the closest you can get.

For anything else, you have no choice but to save to disk and open from
there.

If the files have to be Read-Only, then I recommend you consider a very
different route, such as generating HTML files to be viewed in a
browser, or generating PDF files. Word is NOT designed to be a
"viewer"; you can't securely present content ONLY for viewing in the
manner you describe.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)


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

thanks Cindy
i appriciate your quick answer.
my next question is if it is possible to convert a word document into
WordML format programaticly or do i have to use an external tool for
that
thanks in advance
offa
 
C

Cindy M.

is if it is possible to convert a word document into
WordML format programaticly or do i have to use an external tool for
that
Only by automating the Word application. Then you can use the Open
method to open the file (from disk) and the Save As method to save
back to WordProcessingML *OR* you can pick up the XML using
myString = Document.Content.XML and put that directly in your
database.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
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