"tabonni" <ta*****@yahoo. com> wrote in message
news:fb******** *************** ***@posting.goo gle.com...
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.ht m</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.le ngth; i++) {
if (form.files[i].checked) {
list[j++] = form.files[i].value;
what += "\n" + form.files[i].value;
}
}
alert("Clipboar d List =\n" + what);
window.clipboar dData.setData(" Text", what)
what = "";
//
var oFSO = new ActiveXObject(" Scripting.FileS ystemObject");
for (var k=0; k<list.length; k++) {
var oOTF = oFSO.OpenTextFi le(list[k],1);
var sOTF = oOTF.ReadAll();
what += "\n" + sOTF;
}
alert("Clipboar d Data =\n" + what);
window.clipboar dData.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="Clipboar d" 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.