Visual Studio Developer Center > Visual Studio Forums > Visual Studio Tools for Office > Excel file preview: How to show inside a form?
Ask a questionAsk a question
 

AnswerExcel file preview: How to show inside a form?

  • Monday, November 02, 2009 9:14 PMPeter Kieu Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Good day everyone,

    I am trying to design a template preview form to manage some Excel template documents.

    Could someone have solution to handle Excel file preview as Windows Explorer does?

    Thanks much in advanced!

Answers

  • Wednesday, November 04, 2009 6:38 AMCindy MeisterMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hello Peter

    This functionality is not exposed in the Office object models.

    FWIW, I think the preview thumbnail is stored inside the file. Since Excel 2007 file format is a "package" of Zip files, I'm guessing you could find it there. The correct place to discuss these files is at OpenXMLDeveloper.org.

    If that is not possible, then I believe the only possibility is to take screen shots of what you want to display and store these as graphic files.
    Cindy Meister, VSTO/Word MVP

All Replies

  • Tuesday, November 03, 2009 8:53 AMJi.ZhouMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hello,

     

    What kind of form are you referring to? Do you mean you are creating a Windows Form and want to display Excel content in your Windows Form application?

    If that is the case, you can use WebBrowser or DSOFramer to achieve this objective. I hope the following discussions and links can help you,
    http://blogs.msdn.com/erikaehrli/archive/2005/08/26/hostofficeinnet.aspx
    http://www.codeproject.com/KB/office/Embedding_Excel.aspx

     

    Have a nice day! 


    Ji Zhou

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Tuesday, November 03, 2009 4:11 PMPeter Kieu Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Zi.Chou,

    Thanks for your links.
    However, what I want is a little difference.
    Those 2 articles may , I think, only work well on Office 2003!? (need chance to test this)

    Our system is an Excel 2007 Add-in, namely, we extend more features beside MS Excel (Ribbon tab, commands, and dialogs). Moreover, I hope to add an interesting effect in my Excel template management through Excel file preview data.

    For example, get Preview/Thumbnail data of template files and show transparently them.

    When we save an Excel file, Microsoft Excel 2007 offers a useful option: Save Thumbnail, which can help Explorer to show document previews (at least in Vista and Win7 Explorers).

    In conclusion, could you tell me How to extract the thumbnail data in Excel files?

    Good health!
  • Wednesday, November 04, 2009 6:38 AMCindy MeisterMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hello Peter

    This functionality is not exposed in the Office object models.

    FWIW, I think the preview thumbnail is stored inside the file. Since Excel 2007 file format is a "package" of Zip files, I'm guessing you could find it there. The correct place to discuss these files is at OpenXMLDeveloper.org.

    If that is not possible, then I believe the only possibility is to take screen shots of what you want to display and store these as graphic files.
    Cindy Meister, VSTO/Word MVP