"tabonni" <ta*****@yahoo.com> wrote in message
news:fb**************************@posting.google.c om...
But, when I paste it into outlook. It is not a real file, just text
c:/Temp/file1.txt.
How can I copy the file and paste the real document in outlook? It is
like insert attachments in outlook?
cheers
[snip]
You originally asked that "All filepaths will be copied into clipboard";
"c:/Temp/file1.txt" is a filepath.
To copy all files checked into the clipboard, try:
<html>
<head>
<title>file0.htm</title>
<script type="text/javascript">
function checks() {
var form = document.form1;
var j = 0;
var list = new Array;
var what = "";
//
for (var i=0; i<form.files.length; i++) {
if (form.files[i].checked) {
list[j++] = form.files[i].value;
what += "\n" + form.files[i].value;
}
}
alert("Clipboard List =\n" + what);
window.clipboardData.setData("Text", what)
what = "";
//
var oFSO = new ActiveXObject("Scripting.FileSystemObject");
for (var k=0; k<list.length; k++) {
var oOTF = oFSO.OpenTextFile(list[k],1);
var sOTF = oOTF.ReadAll();
what += "\n" + sOTF;
}
alert("Clipboard Data =\n" + what);
window.clipboardData.setData("Text", what)
}
</script>
</head>
<body>
<form name="form1">
<br><input type="checkbox" name="files" value="c:\temp\file1.txt"> file1
<br><input type="checkbox" name="files" value="c:\temp\file2.txt"> file2
<br><input type="checkbox" name="files" value="c:\temp\file3.txt"> file3
<br><input type="button" value="Clipboard" onclick="checks()">
</form>
</body>
</html>
Be aware that you will get a security warning as FSO is an ActiveX control.
Also, there is a limit to how much data can be placed into the clipboard.