472,965 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,965 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 4238
"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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.