C#: Online Guide
How To: Word SDK
Document Processing
Document Processing
  |  
Home ›› XDoc.Word ›› C# Word: Process Document

C# Word - Document Processing in C#.NET


Provide a Series of Methods to Setup Document Properties and Modify Document Content for Users




Overview



C#.NET Word document  processing Interface control (XDoc.Word).//More TODO allow users to create and process a new document by using our API.


Related .net document control helps:
asp.net azure document viewer: ASP.NET Azure Document Viewer: view, annotate files online using ASP.NET Cloud Service
asp.net create pdf: ASP.NET Create PDF Document Control: create, convert PDF file from Word, Excel, Tiff file formats in C# ASP.NET
asp.net excel document viewer: ASP.NET Excel Document Viewer in C# Control: view office excel files online in ASP.NET web applications
document annotation asp.net: ASP.NET Document Annotation Control: text comment, drawing on files online using ASP.NET component
asp.net sharepoint pdf editor: ASP.NET SharePoint PDF Editor Control: view, edit, annotate, redact PDF document in SharePoint sites
asp.net text document viewer: C# HTML5 Viewer: Load, View, Convert, Annotate and Edit OpenOffice, CSV and Text file
asp.net annotate pdf: ASP.NET Annotate PDF Control: annotate, comment, markup PDF document online using ASP.NET C#




C# DLLs: Word Document Processing



Add references:


  RasterEdge.Imaging.Basic.dll


  RasterEdge.XDoc.Office.Inner.Common.dll


  RasterEdge.Imaging.Drawing.dll


  RasterEdge.Imaging.Processing.dll


  RasterEdge.XDoc.Office.Inner.Office03.dll


  RasterEdge.Imaging.Font.dll


  RasterEdge.XDoc.Word.dll


  RasterEdge.XImage.Raster.Core.dll


  RasterEdge.XImage.Raster.dll


Use corresponding namespaces;


  using RasterEdge.Imaging.Basic;


  using RasterEdge.XDoc.Word;




Get All Images from Word Document



Sometimes we want to extract all images from Word document or Specific page, .XDoc.Word provides a method for users to achieve this requirement. If you happen to have this request, you may use this demo code to get all images from document as follow.




String docFilePath = @"";
//Open the document
DOCXDocument document = DOCXDocument.Open(docFilePath);
//Get the main ducument
IDocument doc = document.GetDocument();
//Document clone
IDocument doc0 = doc.Clone();
//Get all picture in document
List<Bitmap> bitmaps = doc0.GetAllPicture();





Create, Add, Delete or Modify Section in Word Document



We know that there're more than or equals to one section in document, if you want to get some of them or create a new section in Word document, you can use specific APIs to achieve it. The following demo code just shows you how to create a section in document. If you need more operation, you can try it yourself by using our SDK.




String docFilePath = @"";
//Open the document
DOCXDocument document = DOCXDocument.Open(docFilePath);
//Get the main ducument
IDocument doc = document.GetDocument();
//Document clone
IDocument doc0 = doc.Clone();
//Create a section for document
ISection section = doc0.CreateSection(0);
//Save the document
doc0.Save(@"");





Create, Add, Delete or Modify Paragraph and Table in Word Document



If you want to create, add, delete or modify some paragraphs or tables in Word document, you can use specific APIs to achieve it. The following demo code just show you how to create an empty paragraph and a table with 3 columns and 3 rows in Word document. If you need to do more operations, you can try it yourself by using our SDK.




String docFilePath = @"";
//Open the document
DOCXDocument document = DOCXDocument.Open(docFilePath);
//Get the main ducument
IDocument doc = document.GetDocument();
//Document clone
IDocument doc0 = doc.Clone();
//Create a table and a paragraph for document
ITable table = doc0.CreateTable(3, 3);
IParagraph paragraph = doc0.CreateParagraph();
//Save the document
doc0.Save(@"");