How do you open a word document in VB.NET. The document is a manual for the program.
-
Not much point in attempting, cuz you need Office (or at least Word, or Word compatible) installed on the local system to open the file. – OMG Ponies Feb 26 '10 at 01:52
-
.doc can be opened in Wordpad can't they anyway? – Nick Bedford Feb 26 '10 at 02:02
-
@muckdog12 What platform are you using WinForm, WPF, ASP.NET? – TFD Feb 27 '10 at 20:55
4 Answers
You need to call Process.Start(documentPath)
.

- 868,454
- 176
- 1,908
- 1,964
-
1I didn't downvoted yours but for me the right answer is John Smith one. Your answer tell how to start any file associated to a program while the other answer really tell how to open a word document in VB.NET. – LogoS Sep 29 '16 at 23:37
-
@LogoS: No; that answer assumes that the user has Word, which may not be true. It's also much slower. – SLaks Sep 30 '16 at 00:14
-
Maybe the question is not well asked, he/she seems to wanted to open .DOC with some program to show it, not open it "IN VB.NET", in which case, maybe your answer fit. But your answer didn't work for me. I wanted to open .doc to work with it from VB (modify the content programatically), not to make it possible for the user to work with it. – LogoS Oct 06 '16 at 22:27
You open it by:
Dim oWord As Word.Application
Dim oDoc As Word.Document
oWord = CreateObject("Word.Application")
oWord.Visible = True
oDoc = oWord.Documents.Add("C:\wordfile.docx")
Don't forget to use Imports Microsoft.Office.Interop.Word

- 10,218
- 26
- 54
- 62

- 81
- 1
- 3
Use Process.Start
to launch a Word document in the appropriate editor.
If you have access to the assemblies, you can use the Microsoft.Office.Interop.Word
namespace to manipulate Word documents in code, though this is probably nowhere near as trivial as Excel interop, unless you're making very simple word documents.

- 4,365
- 30
- 36
The Microsoft Web Browser Control can display ActiveX documents. This control can be placed onto a WinForms or WPF application
Microsoft Word is a ActiveX document provider. So you can load Microsoft Word documents into the Web Browser control. See this example for VB.Net 2005
You then have total control of the Microsoft Word child window. Load any document, re-size window, change visibility etc, you can even send control messages (macros)
Some other SO references: