[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
ASPFAQ_Open_Application_Client_Side
Normally clicking on a link such as <a href="some.doc">A Word document[/b]</a> the browser will try to open and display the file in the application associated with the file type in the href attribute.
However, if you wish to manipulate this programatically or want to do more with the file's content eg. editing or saving (will be shown in further examples) then you can open an application as in the examples below.
In this case JavaScript or VBScript can be embedded in the ASP page that will run on the client.
JavaScript example:
Use the new ActiveXObject command to create a new application object then set its visibility property to true.
VBScript example:
Use the CreateObject command to create a new application object then set its visibility property to true.
Related threads:
open server side file
Back to ASP FAQ
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
ASPFAQ_Open_Application_Client_Side
How to open an MS Word application on the client?
The example shows how to open an MS Office Word application on the client. It can be useful when dealing with lots of documents in a proprietary format that the users want to view or edit but the ISP of the website may not allow to run the specific application on their server.Normally clicking on a link such as <a href="some.doc">A Word document[/b]</a> the browser will try to open and display the file in the application associated with the file type in the href attribute.
However, if you wish to manipulate this programatically or want to do more with the file's content eg. editing or saving (will be shown in further examples) then you can open an application as in the examples below.
In this case JavaScript or VBScript can be embedded in the ASP page that will run on the client.
JavaScript example:
<script language="javascript" type="text/javascript">
function runApp() {
var appWord = new ActiveXObject("Word.Application");
appWord.Visible = true; }
</script>Use the new ActiveXObject command to create a new application object then set its visibility property to true.
VBScript example:
<script language="vbscript" type="text/vbscript">
Sub runApp()
Set appWord = CreateObject("Word.Application")
appWord.Visible = True
End Sub
</script>Use the CreateObject command to create a new application object then set its visibility property to true.
Related threads:
open server side file
Back to ASP FAQ
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
