• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 276
  • Last Modified:

Opening microsoft office in a visual basic form


I'd like to know how I can open the microsoft word application (not just a .doc file - the real application) in a vb form. For example in a panel or something.... I think it has to do with OLE containers but I can't find any useful information on the internet...

Thank you.
  • 2
3 Solutions
The easiest way is to set a Reference in your Project to the Microsoft Word Object library.

Dim wdApp as Word.Application
Dim wdDoc as Word.Document

Set wdApp = New Word.Application
wdApp.Visible = True

'you can then open a new document, if you like

Set wdDoc = wdApp.Documents.Add
If you want it on a form, place an OLE control on your form. This will bring up an Insert Object dialog and you can choose a Microsoft Word Document.
You can place a Microsoft Web Browser ActiveX control on a form and host a Word document inside of it - load the file by using something like

    WebBrowser1.Navigate ("c:\temp\test.doc")

You do need to have Word installed for this to work.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now