Pavle_nis

c#

Feb 6th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.93 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. using Spire.Doc;
  12.  
  13. namespace WindowsFormsApp6
  14. {
  15.     public partial class Form1 : Form
  16.     {
  17.         public Form1()
  18.         {
  19.             InitializeComponent();
  20.         }
  21.  
  22.         private void Form1_Load(object sender, EventArgs e)
  23.         {
  24.             string text = "";
  25.             Document document = new Document();
  26.             document.LoadFromFile(@"C:\Users\pavle\Desktop\LoremIpsum.docx");
  27.  
  28.             foreach (Section section in document.Sections)
  29.             {
  30.                 for (int i = 0; i < section.Paragraphs.Count; i++)
  31.                 {
  32.                     text += section.Paragraphs[i].Text;
  33.                 }
  34.             }
  35.  
  36.             textBox1.Text = text;
  37.         }
  38.     }
  39. }
Add Comment
Please, Sign In to add comment