简体   繁体   English

如何使用gembox文档包从Word文档的形状和图表中获取数据?

[英]How can I fetch data from shapes and diagrams of a word document using gembox document bundle?

My word file contains shapes and diagrams with data strings in them. 我的Word文件包含形状和图表,其中包含数据字符串。 Need to fetch those data. 需要获取这些数据。 Gembox Document provides examples of fetching data from header footer and basic paragraph structure. Gembox文档提供了从页眉页脚和基本段落结构中获取数据的示例。

Without checking your file no one can say for sure, nevertheless a shape that contains a text inside of it should be a TextBox element . 没有检查您的文件,没有人可以肯定地说,但是其中包含文本的形状应该是TextBox元素
You can fetch the TextBox text like the following: 您可以像以下方式获取TextBox文本:

DocumentModel document = DocumentModel.Load("Sample.docx");

foreach (TextBox textBox in document.GetChildElements(true, ElementType.TextBox))
{
    string text = textBox.Content.ToString();
    // ...
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM