Blue Theme Orange Theme Green Theme Red Theme
 
Home | Forums | Videos | Advertise | Certifications | Downloads | Blogs | Interviews | Jobs | Beginners | Training
 | Consulting  
Submit an Article Submit a Blog 
 Jump to
Skip Navigation Links
TechnologyExpand Technology
WebsiteExpand Website
Nevron Chart
Search :       Advanced Search »
Home » Office Development » Convert Microsoft Office Word to other formats (pdf, html, rtf, xps)

Convert Microsoft Office Word to other formats (pdf, html, rtf, xps)

This article shows how to convert a Microsoft Word document to other document formats such PDFs, HTML, Rich Text Format (RTF), Text, XML, xps.

Author Rank :
Page Views : 6031
Downloads : 236
Rating :
 Rate it
Level : Beginner
   Print Read/Post comments Post a comment  Similar Articles  
   Email to a friend  Bookmark  Author's other articles  
Download Files:
MSOfficeConvertion.rar
 
 
DevExpress Free UI Controls
Become a Sponsor
 Tag Cloud
 Latest Jobs
More ... 
 Latest Interview Questions
More ... 


This code snippet shows how to convert a Microsoft Office Word document to other document formats such 

PDFs, HTML, Rich Text Format (RTF), Text, XML, xps. We are going to use Office Interoperability for this purpose. 

Download the Primary Interop Assemblies (PIAs) from following links.

MS Office 2007

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=59daebaa-bed4-4282-a28c-b864d8bfa513&displaylang=en

MS Office 2010

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=938fe8ad-583b-4bd7-a345-23250dc15855

Adding the references.

  • Right click on your project.
  • Select Add Reference.
  • Go to .Net tab.
  • Select Microsoft.Office.Interop.Word from list.
    Samples attached using MS Office 2010 PIAs.
    1.jpg

    Sample codes attached. If you have any questions, post them below.

Comment Request!
Thank you for reading this post. Please post your feedback, question, or comments about this post Here.
Login to add your contents and source code to this article
 Article Extensions
Contents added by Suthish Nair on Mar 02, 2011
yes, referring from bin folder only. You need to add the dlls to bin folder. 
Contents added by Sunita Tajanpure on Dec 28, 2010
Does this reference to Microsoft.Office.Interop.Word or Excel refer to the GAC assembly or to the bin folder?

I want a code that should refer to the sin folder dlls not from the local system assemblies
Can anyone tell how to do this?


 [Top] Rate this article
 
 About the author
 
Suthish Nair

Mindcracker MVP

Technical Team Lead, Application Developer.

Looking for C# Consulting?
C# Consulting is founded in 2002 by the founders of C# Corner. Unlike a traditional consulting company, our consultants are well-known experts in .NET and many of them are MVPs, authors, and trainers. We specialize in Microsoft .NET development and utilize Agile Development and Extreme Programming practices to provide fast pace quick turnaround results. Our software development model is a mix of Agile Development, traditional SDLC, and Waterfall models.
Click here to learn more about C# Consulting.
 
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Dynamic PDF
ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
Discover the Top 5 .NET Memory Management Fundamentals
To write the best .NET code, you need to know exactly how the .NET framework really manages memory. Ricky Leeks presents the Top 5 fundamental facts of .NET memory management. Learn more.
Nevron Chart for .NET 2010.1 Now Available
The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
ASP.NET 4 Hosting
Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites – Click Here!
 
 Post a Feedback, Comment, or Question about this article
Subject:
Comment:
Nevron Chart
Become a Sponsor
 Comments
Old Format Word Files in C# by Peter On September 11, 2010
Hi,
I have a large number (2000+) of word files from my Mac (MS Word 2004 for Mac) that I have transferred to my XP machine. I wish to open them in a c# 2010 express application that I am developingg. I have Office 2010 installed on that machine also.

I have used your suggestions to open the files. If I open them first in Word 2010, then my application will open them fine. If I attempt to open them direct (after changing the extension to .doc), I get an InteropServices.COMException.
Any ideas?
Thanks,
Peter
Reply | Email | Modify 
Convert docx/xlsx to doc/xls using aspnet 2.0 by vijay On March 7, 2011
Thanks for that. I already used it.But the Client side dont have any ms office suite installed. So i tried with "MS Office" viewer. I think its a freeware and just installed in client machine will help them to view/Print the document with one Constraint that it has to installed on all machine in the Client Side. Like that is there any other option that can be installed in Server and shared with the Client Machine that connect to that Server. Thanks,
Reply | Email | Modify 
Nevron Chart
 © 2012  contents copyright of their authors. Rest everything copyright Mindcracker. All rights reserved.