Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy HTML with VBScript? 1

Status
Not open for further replies.

link9

Programmer
Nov 28, 2000
3,387
US
I need to be able to put a vbscript function on a page that will copy the page onto the clipboard so that it can be pasted into excel later. The users for this site are not what we would call 'savvy', so they want a quick and easy button to push, and it's up to me to give it to them.

Does anyone out there know of a way to do this?

Javascript would also be fine if you know of a function that way.

Thank you,
Paul Prewett
 
In IE you can do the following...
Code:
<html>
<script language=&quot;javascript&quot;>
function fnDoCopy(){
 textRange = document.body.createTextRange();
 textRange.moveToElementText(tblCopy);
 textRange.execCommand(&quot;Copy&quot;);
 alert(&quot;The table has been copied to your Windows clipboard.\n\nYou can paste this information into Excel, Word, etc.&quot;)
}
</script>
<body>
<a href=&quot;javascript:fnDoCopy()&quot;>Copy</a><br>
<table id=&quot;tblCopy&quot; name=&quot;tblCopy&quot;><tr><td>Here is some stuff</td></tr></table>
</body>
</html>

Hope it helps, Rob
robschultz@yahoo.com
-Focus on the solution to the problem, not the obstacles in the way.-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top