using System.Collections.Generic;
using System.IO;
using NPOI.XWPF.UserModel;
using UnityEngine;
public class SeeWordContent : MonoBehaviour {
void Start ()
{
FileStream file = new FileStream("C:\\Users\\Admin\\Desktop\\test.docx", FileMode.OpenOrCreate, FileAccess.ReadWrite);
XWPFDocument word = new XWPFDocument(file);
foreach (XWPFParagraph paragraph in word.Paragraphs)
{
string message = paragraph.ParagraphText;//获取段落内容
Debug.Log(message);
}
file.Close();
}
}
配套的NPIO,DLL文件链接:https://pan.baidu.com/s/13pUeaBqHPq-IQG779bI82g
提取码:8888