FAQ: How do I open/view Office documents (Word, Excel, PowerPoint) in a VB.NET Form?

Locked FAQ: How do I open/view Office documents (Word, Excel, PowerPoint) in a VB.NET Form?

Locked

  • Friday, April 10, 2009 2:24 PM
     
     

    How do I open/view Office documents (Word, Excel, PowerPoint) in a VB.NET Form?


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.

All Replies

  • Friday, April 10, 2009 2:25 PM
     
     Answered

    Visual Basic .NET doesn’t provide an OLE control that lets you embed an Office document in a form. Here are two approaches:

     

     

    1)    Use the Microsoft WebBrowser control (Shdocvw.dll) to open an Office document in VB.Net or C#


    Detail: http://support.microsoft.com/kb/304662

     

    2)    The Visual C++ ActiveX Control named DSOFramer.ocx can be used to host Office documents (such as Word documents, Excel spreadsheets, Visio drawings, Project files, or PowerPoint presentations) in Visual Basic (VB6 and VB.NET) or HTML.


    Example: Hosting Office in .NET applications

    http://blogs.msdn.com/erikaehrli/archive/2005/08/26/hostofficeinnet.aspx

     



     
    For more FAQ about Visual Basic .NET General, please see Visual Basic .NET General FAQ


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.