Forum Moderators: not2easy

Message Too Old, No Replies

Problem pasting text into MS Word from IE when using CSS

Pasting text into MS Word from IE with CSS

         

coldwell6

7:06 pm on Jul 8, 2004 (gmt 0)

10+ Year Member



I have created a website using css positioning and styles that has issues when I "cut and paste" the text from IE to MS Word using the default paste. By default it pastes nothing. The paste does work if I do paste special --> plain text. It also works if I remove the style sheets from the HTML. And of course it works when pasting from every other browser.

Try it <snip> An interesting thing is that the problem does not occur on the site search results page which comes from atomz.com but uses the same style sheet as the rest of the site.

My guess is that Word is trying to improperly apply the style sheet to the pasted text. However, I'm not sure. I have looked online (google, a list apart, etc.) and have found nothing.

The HTML is mostly XHTML 1.0 Transitional but not exactly (I edit using Visual Studio which rewrites some for my proper XHTML into "MS HTML" - a separate topic altogether).

Any ideals? Thanks!

[edited by: SuzyUK at 7:30 pm (utc) on July 8, 2004]
[edit reason] sorry No URLs per TOS #13 [webmasterworld.com] [/edit]

SuzyUK

7:58 pm on Jul 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi coldwell6 & Welcome to WebmasterWorld!

The Urls's were removed per the TOS, but I just wanted to let you and others know, that I tested your site and yes had the same problem, I also then went and tested my own site and it pasted but it took a lot time to think about it so it could be a specific CSS trigger..

I am "destructing" (;))your code as we speak I think it may be possible to narrow it down to a trigger, will let you know..

Does anyone else recognise this or know of the cause?

Suzy

Noisehag

8:08 pm on Jul 8, 2004 (gmt 0)

10+ Year Member



Does anyone else recognise this or know of the cause?

Don't know the cause, but I have several sites that suffer from this problem. I look forward to your analysis Suzy.

SuzyUK

8:10 pm on Jul 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



found it I think..

you have this in the head of your page

<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html>
<head>
<title>Page Title</title>
<?xml version="1.0" encoding="iso-8859-1"?>

the <xml> declaration (in bold) should be the very first thing on the page, moving it up there makes the text pastable, try this...


<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<title>Your Page Title</title>

let us know

Suzy

[edited: for grammar..]

[edited by: SuzyUK at 8:15 pm (utc) on July 8, 2004]

SuzyUK

8:14 pm on Jul 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



FYI I removed all CSS from the page and the text still wasn't pastable..

so Noisehag on your sites that have the problem can you take one of the pages and remove the CSS, is the problem still present and if so what's left in head section?

Suzy

Noisehag

8:26 pm on Jul 8, 2004 (gmt 0)

10+ Year Member



Yes, I'll check it out in a couple hours and report back. I'm not at work at the moment.

coldwell6

8:37 pm on Jul 8, 2004 (gmt 0)

10+ Year Member



Yep, the xml declaration is the problem. Now I just need to find out if I got the header wrong or if visual studio is changing it on me.

Thanks so much! I'd looked all over for this.

Noisehag

4:14 am on Jul 9, 2004 (gmt 0)

10+ Year Member



Okay, removing the doctype allows me to highlight and copy normally. Additionally, if I remove just the style definitions, I can highligh and copy normally. This is consistant over 4 of my sites. Very strange indeed.

Noisehag

6:22 pm on Jul 13, 2004 (gmt 0)

10+ Year Member



Possible work around? I have not looked into it yet.

[webmasterworld.com ]