Microsoft KB Archive/183154

= WD95: Unsaved Information Lost Printing from OS Shell =

Article ID: 183154

Article Last Modified on 8/17/2005

-

APPLIES TO


 * Microsoft Word 95 Standard Edition
 * Microsoft Word 95a

-



This article was previously published under Q183154





IMPORTANT: This article contains information about editing the registry. Before you edit the registry, make sure you understand how to restore it if a problem occurs. For information about how to do this, view the "Restoring the Registry" Help topic in Regedit.exe or the "Restoring a Registry Key" Help topic in Regedt32.exe.



SYMPTOMS
In Word, if you print an open document from the operating system shell rather than from within Microsoft Word, you may lose unsaved information. Examples of printing a document from the operating system shell include:


 * Dragging a document icon from Windows Explorer to the Printer icon
 * Right-clicking a document icon and clicking Print



CAUSE
Printing from the operating system shell invokes a series of Dynamic Data Exchange (DDE) commands from the registry. These DDE commands instruct Microsoft 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 Microsoft Word program (click Print on the File menu in Microsoft Word) 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 Microsoft Word to close the document without saving changes. If the document has unsaved changes, the following workarounds will make Microsoft Word prompt you before it closes the document.

WARNING: Using Registry Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk.

For information about how to edit the registry, view the "Changing Keys And Values" Help topic in Registry Editor (Regedit.exe) or the "Add and Delete Information in the Registry" and "Edit Registry Data" Help topics in Regedt32.exe. Note that you should back up the registry before you edit it. If you are running Windows NT, you should also update your Emergency Repair Disk (ERD).

Displaying a Prompt When You Right-Click the Document Icon and Click Print
To change the registry entry so that Microsoft Word will prompt you to save changes when printing from the document icon shortcut menu, follow these steps:

 Quit Word. Click the Start button, and then click Run. In the Open box, type RegEdit, and then click OK.  Locate the following registry subkey: HKEY_CLASSES_ROOT\Word.Document.6\shell\print\ddeexec This key contains the series of DDE commands that are used when printing a document from the operating system shell  In the pane on the right, click the Default entry.</li> On the Edit menu, click Modify.</li>  Replace the value data with the following and click OK: <pre class="fixed_text">[REM _DDE_Minimize][FileOpen(\"%1\")][t=IsDocumentDirty] [FilePrint 0][SetDocumentDirty t][DocClose] </li></ol>

NOTE: Enter the new value on a single line.

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

Displaying a Prompt When You Drag a Document to the Printer Icon
To change the registry entry so that Microsoft Word will prompt you to save changes when dragging the document icon onto a printer icon, follow these steps:

<ol> Quit Word.</li> Click the Start button, and then click Run.</li> In the Open box, type RegEdit, and then click OK.</li>  Locate the following subkey in the registry: <pre class="fixed_text">HKEY_CLASSES_ROOT\Word.Document.6\shell\printto\ddeexec This key contains the series of DDE commands that are used when printing a document from the operating system shell </li> In the pane on the right, click the Default entry.</li> On the Edit menu, click Modify.</li>  Replace the value data with the following information and click OK: <pre class="fixed_text">[REM _DDE_Minimize][FileOpen(\"%1\")][t=IsDocumentDirty] [FilePrint 0][SetDocumentDirty t][DocClose] </li></ol>

NOTE: Enter the new value on a single line.

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

<div class="status_section">

STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.

<div class="moreinformation_section">

MORE INFORMATION
There are several fields that 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 will be prompted to save any document containing dates and page numbers when you print it from the operating system shell.

Additional query words: regetid

Keywords: kbbug kbfix kbinterop kbprint kbenv KB183154

-

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

© Microsoft Corporation. All rights reserved.