473,698 Members | 2,632 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.s etData function to do that? I saw a lot
of examples they are just copy and paste text.

Thanks
Jul 23 '05 #1
5 4334
"tabonni" <ta*****@yahoo. com> wrote in message
news:fb******** *************** ***@posting.goo gle.com...
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.s etData 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.le ngth; i++) {
if (form.files[i].checked) {
what += form.files[i].value + "\n";
}
}
alert("Clipboar d = \n\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>
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.119 792$mD.80881@at tbi_s02>...
"tabonni" <ta*****@yahoo. com> wrote in message
news:fb******** *************** ***@posting.goo gle.com...
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.s etData 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.le ngth; i++) {
if (form.files[i].checked) {
what += form.files[i].value + "\n";
}
}
alert("Clipboar d = \n\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>

Jul 23 '05 #3
"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.
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.274 57$3l3.13092@at tbi_s03>...
"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.

Jul 23 '05 #5
"tabonni" <ta*****@yahoo. com> wrote in message
news:fb******** *************** ***@posting.goo gle.com...
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
2557
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 idea is: When user checked the checkboxes for the requested PDF files from ASP page and press the "Add To Clipboard" button, all requested PDF files will be copied into clipboard. Then, the user open MS outlook message and right click -> Paste all...
2
3701
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
2705
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 website compatible with macintosh. the same functions dont work on a mac, so i am asking if anyone knows how the "copy to clipboard" function (for text and images!) works on macintosh or if it works at all on a mac.
3
2138
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). When the form is completed, the visitor may display it in another window for verification, printing or sending by e-mail. When he opens the second window, the form's content is send automatically to the clipboard so it could be pasted in another...
7
17988
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 each of the widgets using a temp variable to hold the text, but I don't wnat to reinvent the wheel if there already is something that does the job. Thanks, Bill
0
259
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 aren't seen as DataFormats.FileDrop), so I'm not able to Paste these Attachements. The working routine for 'normal' files is like this: Dim iData As IDataObject = Clipboard.GetDataObject() If iData.GetDataPresent(DataFormats.FileDrop) Then
0
1456
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 ONCE, that means, copying & pasting the text must happen together on the Button_Click event handler! when we use javascript to store the selected text into a variable, we must use this code snippet:
0
1408
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 in the grid. I'll need to remove these two columns from clipboard. 2) The headings are not being copied to clipboard.
2
3323
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 i click it, i want the image in kodak image edit control to be copied to clipboard.
0
8612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9171
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8880
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7743
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2342
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.