Data That You Copy by Using the setData Method Is Not Pasted in Rich Text Applications (826008)



The information in this article applies to:

  • Microsoft Internet Explorer (Programming) 6 (SP1)

SYMPTOMS

When you use the window.clipboardData.setData method to programmatically copy text to the Clipboard, incorrect text is pasted in Rich Text-compliant applications such as Microsoft Word. This behavior occurs if you manually copy text from a Web page to the Clipboard by clicking Copy on a shortcut menu or by using the Edit menu in Microsoft Internet Explorer, and then you call window.clipboardData.setData to copy some other text programmatically to the Clipboard.

RESOLUTION

A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Microsoft Internet Explorer 6 service pack that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

The English version of this hotfix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
  Date         Time   Version        Size       File name
  --------------------------------------------------------
  02-Oct-2003  20:26  6.0.2800.1269  2,799,104  Mshtml.dll
This hotfix is included in the following security update:

STATUS

Microsoft has confirmed that this is a problem in Microsoft Internet Explorer 6 Service Pack 1.

Steps to reproduce the behavior

  1. Paste the following code in Notepad, and then save the file as Test.htm:
    <HTML>
     <HEAD>
     <SCRIPT>
     function copy() {
     window.clipboardData.setData("Text","My text in setData");
     }
     </SCRIPT>
     </HEAD>
     <BODY>
     <B>Copy this text first</B>
     <INPUT onclick=copy() type=button value="Then click this button to copy the data by using the setData function."
     name=button1>
     </BODY>
     </HTML>
  2. Select the "Copy this text first" text on the page, and then copy it to the Clipboard by clicking Copy on the shortcut menu, or by clicking Copy on the Edit menu in Internet Explorer.
  3. Click Then click this button to copy the data by using the setData function to copy the "My text in setData" text by calling window.clipboardData.setData.
  4. Open any Rich Text editor, such as Word or WordPad, and then try to paste the text that is in the Clipboard. Notice that the correct text is not pasted. The "Copy this text first" text that you manually copied to the Clipboard is pasted, instead of the "My text in setData" text that you copied later by using the setData method. To paste the correct text, click Paste Special on the Edit menu. In the Paste Special dialog box, click Unformatted Text.

Modification Type:MinorLast Reviewed:10/26/2005
Keywords:kbHotfixServer kbQFE kbHotfixServer kbQFE kbIE600sp2fix kbIE600preSP2fix kbfix kbbug KB826008 kbAudDeveloper