There are numerous scenarios in which you need just to display Word documents with a limited interaction from the user, like when providing a service of access to documents that don't need to be converted to another format to be accessed by the users. In cases like this, you could try the tool Spire.DocViewer for .NET (you can also other reviews I wrote for other E-Icleblue: Spire.PDF, Spire.Presentation, Spire.XLS and Spire.DataExport). This is a tool to manipulate Word documents in .NET, and it allows us to:
- View Word Documents
- Easily print Word documents
- Convert document formats
- Visual Studio 2015 Community Edition (you can download it from here)
- Any PowerPoint presentation. You can even download one from sites like this: http://www.free-power-point-templates.com/sample-powerpoint-presentation/
- Spire.DocViewer installed (download it from here)
- A new Windows Forms project called "TestoolsDocViewer"
- The Spire.DocViewer.Forms.dll reference added to the project.
For these two last requirements, you might want to check instructions used for similar tools from E-IceBlue. Please check the instructions to create new projects and add references here and here.
1. Add ToolStrip to the form, and inside it, add two buttons one to open a document and the other to close it. Use this button:
to add the buttons. You should see something like this when you're done:
Let's say that the first button is to open and the second is to close the document. You can change the default image if you want.
2. Double click Form1.Designer.cs. Here, we'll add the code for a field to display the document. This is not in the toolbox because is a Spire.DocViewer element. Here's the complete code of that file:
Now, you should see this in the designer view of the form:
3. Next, we have to add code to the Form1.cs file. Basically, what I do here is:
- Add the code in the button for opening documents
- Add the code in the button for closing documents
Save everything. Now, just click Start and you'll see you'r app working:
Now, let's get it work:
Press the first button at the left. A window will opened and you'll be able to browse a doc file. Select it and it will be displayed in the Doc Viewer area:
To close the document, just click the second button.
As with other E-IceBlue products, my experience was positive, mainly because the easy usage of the product. However, I spent some time coding the Doc View in the design file because there was no element in the toolbox for this. I think it would be great if they automatically add the design element to the toolbox when the installation happens. Other than that, I enjoyed using this product. It's easy enough to learn from the demo coding files, but it would be good to have a little tutorial for the design part. You can get more information about this product in the official webpage: http://www.e-iceblue.com/Introduce/word-viewer-net-introduce.html#.VzjSFWgrKhd
Check my reviews of other E-Icleblue products: