locked
Show/hide image in Word 2007 RRS feed

  • Question

  • What is the best way to toggle the visibility of an image in Word 2007 using VSTO3 in VS.NET 2008 beta 2? In VBA you could name the shape and set the Visible property, but since there is no UI for naming shapes I dont know how to do this with VSTO.

     

    I'd rather not put the image inside a bookmark, but maybe that's the only solution?!?

     

    // Johan

     

    Monday, August 13, 2007 8:28 AM

All replies

  • Hi Johan

     

    I'm going to move this message thread to the VSTO 2008 (Orcas) forum, as that's where the expertise is for that version.

     

    As far as I know, the object model interface for the Shapes and InlineShapes haven't really changed in Word 2007. The new graphics engine wasn't fully implemented in Word, so it basically still uses what worked in earlier versions. You do have to distinguish between the two collections. They share some properties and methods, but not all. There has never been a Name or Visible property for InlineShapes; and it's not possible to bookmark a Shape. Perhaps that's where you're getting confused?

     

    To allow the user to name a shape you have to provide the UI (all versions of Word).

    Monday, August 13, 2007 10:57 AM