PDA

View Full Version : Copy the Content of a web page


philip2981
07-17-2002, 05:47 PM
I'm looking to copy the entire content of one page to the clipboard to then be able to paste it into word.

I have seen the code to do this using a textarea, however, I have graphics and formating that I would loose if I did that.

Can someone please help


Thanks

neil.c
07-17-2002, 09:31 PM
i found this on a quick google search.

http://www.htmlgoodies.com/beyond/clipboard.html

it relies on using references - you might be able to set an id for the <html> tag itself and refer to everything between the html tags. i don't know.

only works in IE 4+.

alternatively, ctrl+a, ctrl+c and ctrl+v should do the trick. just post a message on your page about how to do it.

philip2981
07-17-2002, 09:43 PM
neil.c
Thanks that did help...to a point....


I was able to copy the text, however, i lost my formating (bold, italics, etc) and it also did not copy the images.


I have a pop-up window with the Ctrl+ commands....but I'm building a web based tool and I was asked to automate it as much as possible.

As an addition I am trying to take the page from IE into word...might I be able to do it with a word macro????

neil.c
07-17-2002, 09:50 PM
hmmm....
i don't know about macros or anything like that. i'm a javascript beginner too, i've just picked up some of the basics. and i wouldn't expect two microsoft applications to be that closely linked. but you never know.

either hope one of our resident experts comes along, or try and find your way around the msdn library:

http://msdn.microsoft.com

good luck :thumbsup:

[EDIT] well, look at that. i've been upgraded to a 'member' already!

boxer_1
07-17-2002, 09:59 PM
You could also click 'Save as' in your browser and save the 'comlete' page to your HD, then open it in word :thumbsup: . You can also open word, click open, and type in the URL where it says file name and that will draw the page into word.