Open WORD doc in seperate window without the traditional toolbars.

I want to open a word document in a new window without the standard MS WORD toolbars and menu's?
I want the client to just look at the document without giving him the possibility to use the MS WORD functions as SAVE, OPEN, etc.

Who can help me in this matter ???

Thanx.
benmarkenAsked:
Who is Participating?
 
NushiConnect With a Mentor Commented:
Try this out

<html>

<head><title>load document</title>
<script language="JavaScript">
<!--//
function loadworddoc(){

      var doc = new ActiveXObject("Word.Application");
      var txt;
      doc.Visible=false;
      doc.Documents.Open(document.all.hello.value);
      txt = doc.Documents(document.all.hello.value).Content;
      document.all.myarea.value = txt;
      doc.quit(0);
}
function onBrowseClick() {
document.all['inp_File'].click();
}
</script>
</head>

<body>

<p><input type=button onClick="loadworddoc();" value="Load">

<p><input type=file name=hello>


<p>
<textarea name=myarea cols=50 rows=5>nothing here yet</textarea>
<br>


</body>

</html>

it will read the content of the document in to html text area.

Nushi.
0
 
NushiCommented:
do you want to aloow him to change anything?
Nushi.
0
 
ZontarCommented:
There are several problems with your script, nushi:

1. ActiveX only works on MSIE/Windows.

2. You can't set the value for a file input.

3. A file input allows the browsing of the user's own local filesystem, not the filesystem on the server.

4. Furthermore it's not possible to keep someone from saving a file viewed over the Web -- if the user can view it, then a copy of it exists on the user's hard drive.

What you desire is simply not possible, Word toolbars or not. See #4 above.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
NushiCommented:
1. Word is also windows only as far as i know.
2.
0
 
NushiCommented:
1. Word is also windows only as far as i know.
2.
0
 
NushiCommented:
1. Word is also windows only as far as i know.
2.
0
 
NushiCommented:
sorry about it i was dissconected for some reason
and i cliked tab +ENTER.

Zontar some remarks regarding your comment

1. Word is also windows only as far as i know.
2. >>You can't set the value for a file input.
    Using active x you can do it.
 try the script pand see it in action

3. it can be on network as long as you have access to it (if you have network drive mapped).

4. here you are right.
    if its opened as word document it cant be prevented since its a plug-in/ActiveX
    thats has its own framework (toolbars  for example).

:-))
Nushi.

         
0
 
ZontarCommented:
Office for Mac has been around for a long time. Word files can also be opened and viewed with OpenOffice and StarOffice on Linux, BSD, and Solaris.

ActiveX is not Web programming, it's Windows programming. It's also a horrid thing to use on the Web -- it's a security hole among other things. Besides, you're not using ActiveX to set the value of the file input, it is not possible to do this -- the user's action browses and sets the value (and yes, I do know what I'm talking about -- just because I don't like ActiveX does not mean I'm ignorant of its capabilities). When you click the "Browse" button, you're presented with a file-picker. The value is NOT pre-determined. Any value you place in the value attribute is ignored by the browser. Even Microsoft is not silly/irresponsible enough to allow programmers to override this in MSIE -- it would be a huge security risk.

And even MSDN says that document.all should not be used anymore, and that you should use W3C DOM methods like document.getElementById() instead.
0
 
NushiCommented:
>>Office for Mac has been around for a long time. Word files can also be opened and viewed with OpenOffice and StarOffice on Linux, BSD, and Solaris.

that new to me
>>document.all
i agree with you about that.
0
 
benmarkenAuthor Commented:
Thanx guys but this is not the solution i was looking for.
I need a NEW window (_new) without the toolbars and menu's of msword.

The script should be used in a windows/msie environment so that should be ok.

Nushi script works ok but it does not show me the background and the headers and footer in the word document.
I guess that zontar is right that what i want is not possible.

thanx again
0
 
NushiCommented:
>> Nushi script works ok but it does not show me the background and the headers
thats beacuse my script reads the content and not the headers/footers

Nushi.
0
All Courses

From novice to tech pro — start learning today.