none
Restore an image to a Word document RRS feed

  • Question

  • I am able to save & restore an image to a Word document (2010 & 2007) from encrypted storage with my add-in.  The process is required to be performed with document open in Word and the user present.  The question I have is how to restore the image, & all its properties, without the image flashing as the properties are applied? 

    In Windows app programming you can use the "control.Visible" property.  I have tried the "Word.WdWindowState...." enum but that still causes the window to flash.

    Can the Word update thread be suspended while the image & attributes are applied then be released to process the changes?

    My add-in is in C#, VS2010 using .NET 4.0

    Tuesday, February 14, 2012 3:48 PM

Answers

  • Hi Cliff

    The only thing the Word API has is Application.ScreenUpdating = False. This may or may not help, you'll have to test it.

    If it does not help, then you'd have to see if you can find something in the Windows API that will stop the repaint.


    Cindy Meister, VSTO/Word MVP

    Tuesday, February 14, 2012 5:05 PM
    Moderator
  • Hi Cindy,

    It took me a bit to get the project sorted out but that worked the charm!!

    Thank you

    • Marked as answer by cmm-Cliff Friday, February 17, 2012 5:09 PM
    Friday, February 17, 2012 5:09 PM

All replies

  • Hi Cliff

    The only thing the Word API has is Application.ScreenUpdating = False. This may or may not help, you'll have to test it.

    If it does not help, then you'd have to see if you can find something in the Windows API that will stop the repaint.


    Cindy Meister, VSTO/Word MVP

    Tuesday, February 14, 2012 5:05 PM
    Moderator
  • Hi Cindy,

    It took me a bit to get the project sorted out but that worked the charm!!

    Thank you

    • Marked as answer by cmm-Cliff Friday, February 17, 2012 5:09 PM
    Friday, February 17, 2012 5:09 PM