The text of this article is not in this database — only its details are. The old site it was published on is gone, but the Internet Archive kept a copy: Creating and opening Microsoft Word document from VB.NET
31 Comments
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.

praveen chauhanPosted Aug 6, 2011, 6:24 AM
bustard
Sue BrownePosted Apr 26, 2011, 4:00 PM
I followed the instructions above exactly, but the code doesn't work.I receive the error Word.ApplicationClass' is not defined. Please help!
Humita MixPosted Jan 24, 2011, 4:50 PM
Hi Very interesting, can I do it, using Wordpad instead of Word? Which library can I use Regards,
satheesh kumarPosted Oct 14, 2010, 2:46 AM
this article information was very useful thank u .... i want to draw different charts in excel using vb.net ..if we click button it have create excel and have to show file with charts... c'd u help me...?
Popi PopioPosted Sep 14, 2010, 10:31 PM
thank you for your's articles, It's very nice ... thanx again all best :)
vaibhav fegadePosted Sep 13, 2010, 9:35 AM
Hi , this word document is opening separately. I want to open this eord document inside same windows form. how should i do this? please help me/.....
aishu beditedPosted Sep 1, 2010, 3:19 AMEdited Sep 1, 2010, 3:39 AM
HOW SHOUL I CREATE TABLES IN VB.NET FOR MS WORD .ITS IN WINDOW FORM ITSELF NOT IN WORD DOCUMENT.I DON WANT TO OPEN WORD FROM VB. SEND ME SOLUTION SOON THANKS & REGARDS, AISHU
samane vnPosted Aug 2, 2010, 4:52 PM
hi i use this code in asp.net web apllication for open a doc file from server on client but it cant open and don't erase any error please help me ApplicationClass oApplicationClass = new ApplicationClass(); DocumentClass D = new DocumentClass(); object nullobj = System.Reflection.Missing.Value; oApplicationClass .Documents.Open(ref fileName, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj);
Ajay PradhanPosted Jul 21, 2010, 1:14 AM
how to open ms word by default in iframe in asp.net c#
harry peterPosted Jul 20, 2010, 2:24 AM
nice article,Microsoft does not recommend using Office application in server-side scenarios. There are great 3rd party .net word document components in the market that do the same job (or even better). From a comparison testing I performed about a year ago Spire.Doc for .NET is the best. more details, http://www.e-iceblue.com/Introduce/word-for-net-introduce.html maybe help to every.
mohamoud eidPosted Jun 17, 2010, 4:56 PM
Mohamoud Dear sir can you help me were i can download vb.net 2010 [email protected]
Marc MatthyseditedPosted Feb 17, 2010, 1:20 PMEdited Feb 19, 2010, 9:04 AM
Thanks for the quick response Mike. However this is not what I'm really looking for. The objective is to store small word documents (a few pages with text and graphs/pictures per doc only) on the c-drive. The vb.net application should allow the user to see the content of a word document (in read only) without opening Word. Solution: in my case I tested several possibilities and the best one is to save the Word files as *.RTF and read them into a Rich Textbox. In order to use a "Try & Catch" I used the Word.Application. Not completely correct but it works now. Dim StreamToDisplay As StreamReader Dim word As New Word.Application Dim doc As Word.Document StreamToDisplay = New StreamReader("C:\Info\Docs\Manual.rtf") Try doc = word.Documents.Open("C:\Info\Docs\Manual.rtf") Catch ex As Exception MessageBox.Show("Error accessing RTF document") End Try rtbARR_REG.Rtf = StreamToDisplay.ReadToEnd StreamToDisplay.Close() rtbARR_REG.Select(0, 0) Best regards and thx again
sepide khoshnoodPosted Jan 26, 2010, 2:05 AM
hi darling how can i add a picturev in a document by wordfromdotnet? how can i write a text or add a pic to a certain position
sepide khoshnoodPosted Jan 26, 2010, 2:03 AM
hi darling how can i add a picturev in a document by wordfromdotnet? how can i write a text or add a pic to a certain position
chauhan yogeshPosted Dec 11, 2009, 11:41 PM
its a very good, excellent solution...... I thanks a lot........
arindam ghoshPosted Nov 21, 2009, 3:39 PM
I am really happy after visiting your sight and be a member of your side. Because my two great programming problems are solved for the help of your Sight. Question: Suppose I develop a software and I am not interested to submit the code just I can submit the set-up of it’s demo .Is it possible? <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p> </o:p>
Renoald TangPosted Sep 13, 2009, 1:38 PM
it is possible read the character or content from word by using vb? since the format word are not same with txt files.
Marcele BarrosPosted Aug 27, 2009, 8:57 AM
Thanks for help!
mahdiPosted Jul 2, 2009, 7:36 AM
How can I open a word doc from vb.net without using open dialog box (by code only)
nguyen thanh binhPosted May 9, 2009, 8:10 AM
I want to open ms word 2003 in vb.net form. I found an example like that. But it's C# Application. Can U help me?
Doug BatchelorPosted Feb 25, 2008, 11:10 AM
Mike, Is it possible to read the contents of Word docs stored as images in sql2005 without opening word on the client side. I need to be able to read the text, highlight keywords with html tags and then spit the result out to an html page. I tried regular expression by reading the doc into a byte array and then converting to a string, but the structure of word made the result very messay. Appreciate any help you can give me.
Scott BlackburnPosted Jan 24, 2008, 5:35 PM
Good Job Mike... This was very benificial to me and worked just fine.... The thing that I need now is a way to pass parms or values to the word document (like mail merge)... Do you have a code snippet that will do that? Thanks again Mike, -scott
Scott BlackburnPosted Jan 24, 2008, 5:34 PM
Good Job Mike... This was very benificial to me and worked just fine.... The thing that I need now is a way to pass parms or values to the word document (like mail merge)... Do you have a code snippet that will do that? Thanks again Mike, -scott
Divyesh DoshiPosted Jul 31, 2007, 2:37 AM
Can i use Windows XP 's wod Reference for Windows 2000's word Reference??
WILLY VERSLYPPEPosted Jun 20, 2007, 5:23 PM
Is it possible with frames or have I to use the ASCII character codes chart 2 with the graphic characters : chr(176)...chr(223) ? I will be very greatfull if you can help me. Thanks
AlicePosted Jun 12, 2007, 1:08 PM
This works fantastic the first time through. If I click the button to open a second document I get the following error: RPC Server is unavailable. Exception from HRESULT: 0x800706BA Did I miss a piece of configuration or am I not closing/ending some object/process that needs closing? I'd appreciate any insight you have on this. Thanks!
John MixoneditedPosted Jun 8, 2007, 11:17 AMEdited Jun 8, 2007, 11:17 AM
Your solution is great. What a nice use of Reflection! You just saved me a huge headache. Regards, jmixon