HTML
JPG
PDF
XML
DOTX
DOTX
DOTX File Viewer for .NET
View DOTX in a browser without requiring Microsoft Word or Office Automation.
How to View DOTX File Using C#
In order to view DOTX file, we’ll use
API which is a feature-rich, powerful and easy to use API for C# platform to be used with any Viewer. Open
package manager, search for Aspose.Words and install. You may also use the following command from the Package Manager Console.
Package Manager Console Command
PM> Install-Package Aspose.Words
Steps to View DOTX via C#
Developers can easily view Microsoft Word DOTX file with just few lines of code.
- Load DOTX file with an instance of Document class
- Call the Document.Save method
- Save DOTX file in HTML Fixed format with embedded resources
- Call Process.Start with path to resultant HTML to load in default browser
System Requirements
Before integrating code, make sure that you have the following prerequisites.
- Microsoft Windows or a compatible OS with .NET Framework, .NET Core, Windows Azure, Mono or Xamarin Platforms
- Development environment like Microsoft Visual Studio
- Aspose.Words for .NET referenced in your project
View DOTX file using C# example code
string output = System.IO.Path.GetTempPath() + Guid.NewGuid().ToString() + ".html";
// load DOTX via an instance of Document
var document = new Document("template.dotx");
// save in HTML Fixed format while embedding all resources
document.Save(output, new Saving.HtmlFixedSaveOptions()
{
ExportEmbeddedCss = true,
ExportEmbeddedFonts = true,
ExportEmbeddedImages = true
}
);
// load resultant HTML in defualt browser
System.Diagnostics.Process.Start(output);
.NET Words API can be used to load, view and convert Microsoft Word and OpenDocument Formats like DOC, DOCX, ODT to PDF, XPS, HTML and various other formats. You can also create new documents from scratch and save them in the supported formats. It is a standalone API that is suitable for server side and backend systems where high performance is required. It does not depend on any software like Microsoft or OpenOffice.
Free App to View DOTX
Other Supported Viewer Formats
Using C#, One can also view many other file formats including.
DOC (Microsoft Word Binary Format)
DOCM (Microsoft Word 2007 Marco File)
DOCX (Office 2007+ Words Document)
DOT (Microsoft Word Template Files)
DOTM (Microsoft Word 2007+ Template File)
HTML (Hyper Text Markup Language)
MD (Markdown Language)
MHTML (Web Page Archive Format)
MOBI (Open Ebook Format)
ODT (OpenDocument Text File Format)
OTT (OpenDocument Standard Format)
PDF (Portable Document Format)
RTF (Rich Text Format)
TXT (Text Document)