473,320 Members | 2,080 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Copy filepath to clipboard & paste it in outlook. How?

Hello All

I am creating an ASP page. There are a list of filename and checkbox
next to it. When user checked all the documents they want and click
ADD TO CLIPBOARD button. All filepaths will be copied into clipboard
and then they can right-click -> paste into MS Outlook as attachments.

How can I use clipboardData.setData function to do that? I saw a lot
of examples they are just copy and paste text.

Thanks
Jul 23 '05 #1
5 4285
"tabonni" <ta*****@yahoo.com> wrote in message
news:fb**************************@posting.google.c om...
Hello All

I am creating an ASP page. There are a list of filename and checkbox
next to it. When user checked all the documents they want and click
ADD TO CLIPBOARD button. All filepaths will be copied into clipboard
and then they can right-click -> paste into MS Outlook as attachments.

How can I use clipboardData.setData function to do that? I saw a lot
of examples they are just copy and paste text.

Thanks


Will this help? Watch for word-wrap.

<html>
<head>
<title>Clipper.htm</title>
<script type="text/javascript">
function checks() {
var form = document.form1;
var what = "";
for (var i=0; i<form.files.length; i++) {
if (form.files[i].checked) {
what += form.files[i].value + "\n";
}
}
alert("Clipboard = \n\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>
Jul 23 '05 #2
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

"McKirahan" <Ne**@McKirahan.com> wrote in message news:<ax%Zc.119792$mD.80881@attbi_s02>...
"tabonni" <ta*****@yahoo.com> wrote in message
news:fb**************************@posting.google.c om...
Hello All

I am creating an ASP page. There are a list of filename and checkbox
next to it. When user checked all the documents they want and click
ADD TO CLIPBOARD button. All filepaths will be copied into clipboard
and then they can right-click -> paste into MS Outlook as attachments.

How can I use clipboardData.setData function to do that? I saw a lot
of examples they are just copy and paste text.

Thanks


Will this help? Watch for word-wrap.

<html>
<head>
<title>Clipper.htm</title>
<script type="text/javascript">
function checks() {
var form = document.form1;
var what = "";
for (var i=0; i<form.files.length; i++) {
if (form.files[i].checked) {
what += form.files[i].value + "\n";
}
}
alert("Clipboard = \n\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>

Jul 23 '05 #3
"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.
Jul 23 '05 #4
It doesn't work. After I checked the files and clicked the Clipboard
button, I tried to paste it in MS outlook. However, files cannot be
pasted. And, the outlook message and the html page (containing
checkboxes and button one) are not responding.

By the way, how can I copy and paste PDF Files?

I should clarify everything in the beginning. Sorry.

Cheers
"McKirahan" <Ne**@McKirahan.com> wrote in message news:<X3j_c.27457$3l3.13092@attbi_s03>...
"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.

Jul 23 '05 #5
"tabonni" <ta*****@yahoo.com> wrote in message
news:fb**************************@posting.google.c om...
It doesn't work. After I checked the files and clicked the Clipboard
button, I tried to paste it in MS outlook. However, files cannot be
pasted. And, the outlook message and the html page (containing
checkboxes and button one) are not responding.
It works if they're ".txt" files.
By the way, how can I copy and paste PDF Files?
You can't.
I should clarify everything in the beginning. Sorry.

Cheers

Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: tabonni | last post by:
Hi all I want to create an ASP page, which can copy the real PDF files into the clipboard and then the user can paste it in Outlook message as attachments(it's like inserting attachments) My...
2
by: cv | last post by:
Hi all, How do I copy from clipboard to any control of my page? Any help wud be appreciated. TIA, cv
1
by: Manuel | last post by:
hello everyone in my website i use the methods ".execCommand('SelectAll')" and ".execCommand('Copy')" to copy a defined area to the clipboard, that works fine, but now i wanted to make my...
3
by: Jean-Luc ERNST | last post by:
Hello, I apologize for my english, I'm french speaking... Could someone help me to finalize a little project? I'm writing a form for my site but I'don't know many in Javascript (I'm a newbee). ...
7
by: William Gill | last post by:
Is there a simple way to cut and paste from a tkinter text widget to an entry widget? I know I could create a mouse button event that triggers a popup (message widget) prompting for cut/paste in...
0
by: DraguVaso | last post by:
Hi, I want my application to Paste Outlook 97 Attachements with the ClipBoard or something likE that. Unfortunately the ClipBoard treats Outlook-Attachements otherwise than 'normal' Files (they...
0
by: Mr. Murad Jamal | last post by:
hi guys, I have a textbox & a button in an .aspx page, when I hit the button i want a selected text to be copied to the clipboard AND paste it into the last cursor position on the textbox BOTH AT...
0
by: Curious | last post by:
I'm working on fixing the command of "Copy to Clipboard" from a data grid. The current implementation has two problems: 1) There are two extra columns copied to clipboard that are invisible...
2
by: crapycoder | last post by:
hi all, please help....!! i have added a kodak image edit control on my form. when i click get image button, "abc.img" will be displayed. i have a button named "copy to clipboard". when...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.