How to output a Word document into html page?

F

fumade

Hi guys,
I need to add permission to Word Document pragrammatically.And the
provider it for user to download.
My code likes this:

Document.Open();
Document.Permission.Add()

Response.ContentType = "application/msword";
Response.Write();

How can i Write the Document Object to the html ?
 
F

fumade

What i want to know is that:
If i have a Word Document object, how can i write it(not only the text,
but also the permission and others) to to web page?

Thanks!
 
C

Cindy M.

Hi Fumade,
What i want to know is that:
If i have a Word Document object, how can i write it(not only the text,
but also the permission and others) to to web page?
I don't think you can. Unless the web browser recognizes and supports
Information Rights Management. But I've never heard of IRM being used in that
context, only within the application window.

And certainly there's no way to have Word's proprietary, binary document
format simply turn into HTML. The document can be saved as a web page, and
the result can be loaded into a browser.

But I think you'll need to control the "permissions" end of it in your web
application.

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 :)
 
F

fumade

Hi Cindy
Thanks for you reply.
You said "only within the application window", do you mean "only within
the window application"?

I, myself , also think it is not a good way to automate word on
server-side(by asp.net).

But my scenario is that, our site needs to provide Word Document for user
to download.And we need to add permission to the documents(per user)
programmatically.

We want to insert permission in documents without writing to disk,so we
only get a Document object after adding permission.

I really don't know how to output it.

Should I change can my design ?
 
F

fumade

Hi Cindy
In Word 2003, it alters that IRM permission will be removed if saved in
xml format.

So IRM only works if document is saved in binary format(.doc), is that
ture?

Thanks
 
C

Cindy M.

Hi Fumade,
You said "only within the application window", do you mean "only within
the window application"?
No, I meant only in the WORD application window (instead of a web-browser
window).
But my scenario is that, our site needs to provide Word Document for user
to download.And we need to add permission to the documents(per user)
programmatically.

We want to insert permission in documents without writing to disk,so we
only get a Document object after adding permission.
This isn't going to be possible. Word isn't designed to "stream" its binary
document format.
In Word 2003, it alters that IRM permission will be removed if saved in
xml format.

So IRM only works if document is saved in binary format(.doc), is that
ture?
Yes, that's true. There wouldn't be much point in trying to enforce any
security at that level in an open document format, would there? XML can be
opened and edited in any text editor, after all...

The problem is, you're trying to combine an inherently insecure interface
(web) with a file-oriented, binary protection system. The two just don't
mix. The only alternative that occurs to me would be to provide the
uneditable text sections as graphics files, inserted into the document. Only
the text that can be edited by the particular user is passed as real text.

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