Solved

launch ms-word document in browser

Posted on 2001-07-23
10
499 Views
Last Modified: 2009-07-29

my application needs to call an ms-word document and launch it in the browser.  how do i do this using vbscript? tnx
0
Comment
Question by:marr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +3
10 Comments
 
LVL 5

Expert Comment

by:nilapenn
ID: 6310904
try this

<script language="vbscript">
window.location.href="yourdocumentnamewithpath"
</script>
0
 
LVL 1

Expert Comment

by:raghurani
ID: 6311126
Hi!

You can invoke ms-word (or any such application) only when there is an associated file already available. I do not think you can invoke any application without having an accociated file.

regards,
Raghu

0
 
LVL 1

Expert Comment

by:anupkarade
ID: 6311160
Of Course you can always open an Ms-Word document in the browser.Check the permissions of the virtual directory
in your IIS

you can call this script on any event
<script language="vbscript">
 window.open "./Test.doc","Wintest"
</script>

<script language="vbscript">
 window.open "Full Path","Wintest"
</script>


                            regards
                                      Anup
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 1

Expert Comment

by:raghurani
ID: 6311176
anup saab,

  window.open "./Test.doc","Wintest" will invoke winword, but, you are invoking winword via an associated file ('test.doc', in this case).

 Can we invoke an application without having an associated file with it ? Say for example, if I wish to invoke winword but I do not want winword to open test.doc....

regards,
Raghu



0
 
LVL 1

Expert Comment

by:anupkarade
ID: 6312049
Hi...
  Addressing to the issue as raised by Mr.Raghu
we can open the word application from asp here is the script
 
            Set WordApp = CreateObject("word.application")
         Set WordDoc = WordApp.Documents.Add()
           
  this can be done on client and server side both
  But ,...
  there are many issues tp be solved before it
 
  AspAllowOutOfProcComponents property is to be set true
  in IIS Metabase as defaultly only Inproc components are
   allowed to be instiantiated....
   
   for more details
   refer
   
   http://support.microsoft.com/support/kb/articles/Q285/1/76.ASP   ---for Creation of word doc


http://www.microsoft.com/technet/treeview/default.asp?url=/TechNet/prodtechnol/iis/deploy/config/metabase.asp ---for setting the AspAllowOutOfProcComponents true


right Raghu sab....??

                        regards
                               Anup
   
 
0
 
LVL 1

Expert Comment

by:raghurani
ID: 6312124
Anup,

went through the article.. liked it.. but failed to implement the code... what could be wrong then..
I have set the IE options (to 'prompt' while initia..)

Here is my try.asp file:
------------------------
<html>
<head>
</head>

<body>
<script language=vbscript>
Set WordApp = CreateObject("word.application")
Set WordDoc = WordApp.Documents.Add()

</script>
</body>
</html>
-------------------------

IE prompts me when I access this page, but fails to run winword...

I am running IE 5.0 on Windows 2000...

regards,
raghu
0
 

Author Comment

by:marr
ID: 6329116

how will i call/open the word document from a hyperlink?  also, do the previous codes also apply to ms excel?
0
 
LVL 5

Accepted Solution

by:
nilapenn earned 10 total points
ID: 6329258
just give the path of your word document in the hyperlink

for example

<a href="yourworddocumentpath">yourlinkname</a>

yes this applies to excel also.
0
 
LVL 33

Expert Comment

by:hongjun
ID: 8623292
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
[points to nilapenn]

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

hongjun
EE Cleanup Volunteer
0
 

Expert Comment

by:Chmod
ID: 8674365
As recommended

Chmod
Community Support Moderator @Experts Exchange
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question