在.Net中使用OpenXML-需要在Word文档中搜索特定的单词,并且它应该返回找到它的那一行,尝试这样做可以帮助任何人
public static void OpenWordprocessingDocumentReadonly(string filepath)
{
// Open a WordprocessingDocument based on a filepath.
using (WordprocessingDocument wordDocument =
WordprocessingDocument.Open(filepath, false))
{
// Assign a reference to the existing document body.
Body body = wordDocument.MainDocumentPart.Document.Body;
}
}