PDA

View Full Version : load to external programm


august
08-19-2002, 10:32 AM
Hi i'm new to this forum so please excuse if this has been answered before.
I am currently searching for a way to load files into external programs-specificly speaking i want to create a link that opens text files in the windows text-editor and not in a new explorer window. the idea is to make texts editable without using huge data storage programs or server codes.
Unfortunately i dont know if Explorer can do this at all and if so how it is done. Any Help would be apriciated.

best wishes
August

Digiwarrior
08-19-2002, 12:22 PM
I know what you mean by this, but I am afraid it's not possible (or at least to my know how).

more or less what you want to do is assocate a program with a file type. I know this can easily be done by the computer user, but I do not think a none .exe way could me made to change the assocation....... sorry.

You could tell your viewers how to do this, though.

brothercake
08-19-2002, 12:39 PM
You can open a text file in Notepad using an activeX control - but this would not work on the internet except for those with very low security settings; and even then only in IE

In any case, that would not allow the data to be edited and the re-uploaded; If you want users to be able to edit a text file and then resubmit it, you will need a server-side solution.

august
08-19-2002, 12:59 PM
Thanks for the ActiveX Idea!
The page i'm working on does nor need to work Online its simply a graphical data display for a company intern audition system.
Actually it does not even have to run on the intern network it simply has to show the stuff in a way anyone can understand.
Thats why i dont think its worth working out a database for it.
Can i edit the Textfiles on my own Harddisk this way? And if so could you please send me the proper code for this Active X or tell me where to get it?

brothercake
08-19-2002, 03:34 PM
okay - this will take the text from a textarea and turn it into a .tmp file which is saved on your desktop and then opened in notepad


<html><head></head>


<body>


<script language="VBScript">
' plain text document creation
Sub WriteAndDisplayFile
Dim fso: Set fso=CreateObject("Scripting.FileSystemObject")
Dim strTempName: strTempName=fso.GetTempName()
Dim tempFile: Set tempFile=fso.CreateTextFile(strTempName, True, False)
tempfile.Write textform.VBOutput.Value
tempFile.Close
Dim NoteShell
Set NoteShell=CreateObject("WScript.Shell")
NoteShell.Run "Notepad " & strTempName
End Sub
</script>

<p><form name="textform">
<textarea name="VBOutput" cols=50 rows=10></textarea>
</form>
<p><input type=button id="wadf" language="VBScript" onClick="WriteAndDisplayFile()" value="WriteAndDisplayFile">



</body></html>

august
10-04-2002, 07:49 AM
Hi just recently i found a code to do the thing:



<script>
<!--
function viewthesource(){
window.location="view-source:"+window.location
}
//-->
</script>


and start it with:

<a href="javascript:viewthesource()">open in editor</a>

thanks for all Help guys!