Solved

vb.net and Microsoft word

Posted on 2011-09-13
10
294 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
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 …
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

691 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