Microsoft KB Archive/182837

= Unsaved information is lost when printing from operating system shell in Word =

Article ID: 182837

Article Last Modified on 7/25/2007

-

APPLIES TO


 * Microsoft Office Word 2007
 * Microsoft Office Word 2003
 * Microsoft Word 2002 Standard Edition
 * Microsoft Word 2000 Standard Edition
 * Microsoft Word 97 Standard Edition

-



This article was previously published under Q182837



Important This article contains information about how to modify the registry. Make sure that you back up the registry before you modify it. Make sure that you know how to restore the registry if a problem occurs. For more information about how to back up, restore, and modify the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows registry



SYMPTOMS
If you print an open document from the operating system shell instead of from within Microsoft Word, you may lose unsaved information. An example of printing a document from the operating system shell is when you drag a document icon from Windows Explorer to a printer shortcut icon.



CAUSE
Printing from the operating system shell invokes a series of Dynamic Data Exchange (DDE) commands from the registry. These DDE commands instruct Word to open the document, print the document, and then close the document without saving changes.



WORKAROUND
To avoid this problem, print from within the Word program, or save the document before you print it from the operating system shell.

Or you can change this DDE behavior by modifying the registry entries that tell Word to close the document without saving changes. If the document has unsaved changes, the following workarounds make Word prompt you before it closes the document.

Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall the operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.

Displaying a prompt when you drag a document to the Printer icon
To change the registry entry so that Word prompts you to save changes when you drag the document icon onto a printer icon, follow these steps:  Exit Word. Click Start, click Run, type RegEdit in the Open box, and then click OK. Locate the following subkey in the registry:

Note This subkey will work for .doc files in Word 2007. However, this subkey will not work for .docx files in Word 2007. For .docx files, locate the following subkey in the registry:

Note These keys contain the series of DDE commands that are used when printing a document from the operating system shell. In the right pane, click Default. On the Edit menu, click Modify. Replace the value data with the following information, and then click OK:

[REM _DDE_Minimize][FileOpen(\"%1\")][t=IsDocumentDirty] [FilePrint 0][SetDocumentDirty t][DocClose]

Note Enter the new value on a single line.</li></ol>

Now when you print a document from the operating system shell, you are prompted to save changes if the document contains unsaved changes.

<div class="status_section">

STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

<div class="moreinformation_section">

MORE INFORMATION
Several fields are updated when the document is printed, including date fields and page number fields. If you modify the registry as described in this article, you are prompted to save any document that contains dates and page numbers when you print it from the operating system shell.

Additional query words: regedit OS

Keywords: kbbug kbinterop kbprint kbenv kbpending KB182837

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.