Solved

vb.net and Microsoft word

Posted on 2011-09-13
10
278 Views
Last Modified: 2012-05-12
I am writing a windows app that simply needs to open a word doc and do a saveas .txt file to preserve the auto numbering used in the document.

My question is what dlls would I have to copy with the exe to make use of the word object?  The app will run on a server that is part of a cluster. We don't want to install office or the complete office pias.

Also, where can I find the needed dlls on my local machine to copy them over.

Thanks.
0
Comment
Question by:rutledgj
  • 3
  • 3
  • 2
  • +2
10 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 250 total points
ID: 36532540
If you want to use Word object model without Office, you would need something like this

http://www.aspose.com/categories/.net-components/aspose.words-for-.net/default.aspx
0
 
LVL 40
ID: 36532559
The dll you are talking about is called an Interop. It is offered as an option when you install Visual Studio or Word (version 2003 and on) on a computer. And you are not allowed to distribute it, since the user must have a Word licence in order to use Word.

A little different in Visual Studio 2010, with the framework 4.0, where you have the option of incorporating the necessary parts of the dll into the application.

Anyway, the dll is nothing, it is just a bridge to Word from .NET. Word works from its .exe, not from a dll. In order to use Word with any application (.NET, VB6, VBA, script, you name it), Word has to be installed on the computer on which the application is running.

You will have to fish the Internet to try to find if there is a tool that could make the conversion from .doc to .txt.
0
 
LVL 40
ID: 36532740
I really like the "like" in "like this" in CodeCruiser link :-)

... for the price of 3 Word standalone licences (for something that needs to work on a server so one Word licence would be enough), bigger than Winword.exe, and at first glance, it converts between word processor formats, not .txt.

But CodeCruiser is right, you need something like this. You might want to try at www.ComponentSource.com. When it exists, usually they have it.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

Author Comment

by:rutledgj
ID: 36533152
I'm confused I guess. I thought there was a way to just copy/paste the exe and needed dlls. I am using vs 2010 if that matters but we operate on office 2007. Surely thhere is a way without purchasing a third party component.
0
 
LVL 40
ID: 36533706
You cannot only copy the .exe. It needs to be installed, and you need a proper license to install it.

As for the interop (the dll), now that we know that you are in VS2010, I can tell you about this new wonderful little feature of the 2010 version.

Reference Word as you would any other dll from the COM tab of the Reference window.

The following should be set by default, but just check to make sure. Once the reference is done, click on the reference in the list of active references. In the Properties window, the Embed Interop Types property should be set to True.

With this option set, no need to distribute the dll. The code for the classes you use in your application, and only for those classes, will be embedded in your application. It will be part of your .exe.

But Word still needs to be installed on the computer that runs the application.
0
 
LVL 4

Expert Comment

by:Pacemaker9007
ID: 36534626
If you only need the text, you can extract it, try e.g. this http://www.codeproject.com/KB/office/ExtractTextFromDOCXs.aspx

Otherwise I agree with JamesBurger, it is not a question of coying dlls or exe files, but a question of a valid Word license. You will only need one for a server, so it is not very expensive.
0
 
LVL 4

Expert Comment

by:Pacemaker9007
ID: 36534757
You can also try this http://bytescout.com/products/developer/documentsdk/index.html, it is a free beta, unfortunately I have not tried it so I cannot give you any details.
0
 

Author Comment

by:rutledgj
ID: 36535593
Thanks. It isn't that we don't want to buy Word, We do have many copies of it. They just don't want to install it on a clustered server.  I'll check some of the other suggestions and get back.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 36535681
I am not sure but maybe OpenXML can be used to do that. Start with http://www.emoreau.com/Entries/Articles/2011/03/Using-OpenXML-to-fill-a-Word-document-from-a-Net-application.aspx

But I would definitely go with Aspose. I use it in many projects and it is the way to go.
0
 

Author Closing Comment

by:rutledgj
ID: 36718854
We are going to purchase the Aspose component.
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Multiple file Upload asp.net 2 49
How to remove double quotes from a string in VB.Net 5 47
VB.Net WebRequest Code from JSON curl 9 13
vb.net 1 month apart 11 30
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question