次の方法で共有


Unable to Update Metafile Presentation for OLE 1.0 Object in Word (2002/2003/2007)

Summary

When you insert an OLE 1.0 Object into a new document using Word 2002 or Word 2003, the object will display fine on the initial insert. However, if you edit the object and update the presentation data, the metafile displayed by Word may not get correctly updated. So the object appears unchanged even though its content may actually be changed.

Workaround

After inserting the Word object, save the document, then close and reopen it. Now when you edit the OLE 1.0 object, it should update the presentation data correctly.

More Information

This problem is specific to older OLE 1.0 Object servers. Object servers written using the OLE 2.0 standard will update correctly as expected.

The Packager server that comes with Windows 2000/XP/2003 is an OLE 1.0 object server, so the problem can be reproduced using Packager if you are on a pre-Vista OS version. However, the problem is not specific to Packager. Any OLE 1.0 servers can experience the same issue. Packager was re-written to be an OLE 2.0 server for Windows Vista and Windows 2008.

OLE 1.0 is a legacy version of OLE originally designed for 16-bit Windows programs, and uses a combination of DDE and in-memory stream callbacks. While still supported in Windows 32-bit OS versions, it will not be supported in 64-bit OS versions, and code written to be compatible with Vista/2008 OS versions should be using the OLE 2.0 (COM) architecture instead.

Steps to Reproduce

  1. Start Word 2002, 2003, or 2007 on Windows XP or Windows 2003. A new document is made for you by default.
  2. For 2002/2003, choose Insert | Object menu. For 2007, switch to Insert tab on ribbon, click the Object button.
  3. The Insert Object dialog will appear. In Create new tab, choose Package and press OK.
  4. The Object Packager window will appear. Choose File | Import... from Packager window. Find any local text (*.txt) file and choose OK to insert the file into the package.
  5. Choose File | Update to save package in Word, and then close the Packager window. Notice the icon of the file you choose appears in the Word document with the name of the file under the icon.
  6. Right-click on the embedded object and from its context-menu, choose Object Packager | Edit Package. Packager window will reappear to let you edit the object.
  7. Click inside the left pane where the icon is (Appearance side), then choose Edit | Label... from the menu. In the dialog that appears, replace the file name with some random text string. Press OK. You should see the text update the metafile image in the Appearance side of the Packager window.
  8. Choose File | Update to save changes back to Word, and then close the Packager window.

Result

The new metafile (with the updated label) does not appear in the word document. It failed to get updated.

Comments

  • Anonymous
    February 15, 2008
    When using OLE 1.0 objects in Word, you may experience problems in getting the presentation metafile

  • Anonymous
    February 15, 2008
    When using OLE 1.0 objects in Word, you may experience problems in getting the presentation metafile