
March 19th, 2003, 09:32 AM
|
|
Junior Member
|
|
Join Date: Mar 2003
Posts: 2
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
hey valeech,
tks for the reply. I tested out the file association and my machine already has .doc files associated with MS Word. I kept the target=_blank, should this be changed? As an alternative, in case anyone here wanted to know, I found some jscript code that does this for you. Here is the sample coding that I used to launch the link in MS Word:
<a href="javascript:startWord('<%= sPath2 &sYear& "/"& sFileName%>')">Open Generated File</a>
and add the following jscript:
<script language="JavaScript">
function startWord(strFile)
{
var myApp = new ActiveXObject("Word.Application");
if (myApp != null)
{
myApp.Visible = true;
myApp.Documents.Open(strFile);
}
}
</script>
Note: in order to link to UNC paths, make sure that strFile is using "/" in its path versus the conventional "\". For eg. use:
//computer/folder/file instead of \\computer\folder\file.
|