[英]Extract Bulleted Text From Powerpoint
I am trying to extract bulleted text from powerpoint slides.我正在尝试从 PowerPoint 幻灯片中提取项目符号文本。 But I couldn't find any helpful function which can provide information about if current line is in bullet list or not.
但是我找不到任何有用的功能可以提供有关当前行是否在项目符号列表中的信息。 I tried identifying it using indent level, but I dont find it useful either.
我尝试使用缩进级别来识别它,但我也不觉得它有用。
For example:例如:
If slide contains text like:如果幻灯片包含以下文本:
Abcdefg...
. B
. C
. D
.E
In this, there are 5 paragraphs, if get indent level of each paragraph it will come as :其中,有 5 个段落,如果获取每个段落的缩进级别,它将变为:
Paragraph IndentLevel
Abcdefg... 1
B 1
C 1
D 2
E 3
Here, first 3 paragraph have same indent level, but only B and C are in bulleted list, so my program should B, c, D, E.在这里,前 3 段具有相同的缩进级别,但在项目符号列表中只有 B 和 C,所以我的程序应该是 B、c、D、E。
Here, i dont have any way to figure out if this para starts with bullet or not.在这里,我没有办法弄清楚这个段落是否以子弹开头。
Can you please help?你能帮忙吗?
Thanks, Kailas谢谢,凯拉斯
Code that I am using for retrieving text我用于检索文本的代码
public void analyzeText( PowerPoint.Shape shape )
{
if( shape.HasTextFrame == Office.MsoTriState.msoTrue && shape.TextFrame.HasText == Office.MsoTriState.msoTrue )
{
PowerPoint.TextRange textRange = shape.TextFrame.TextRange;
string text = textRange.Text;
MessageBox.Show(text);
for( int i=1; i<=textRange.Paragraphs().Count; i++)
{
MessageBox.Show("Paragram COunt : " + textRange.Paragraphs(i).Text + " Indent " + textRange.Paragraphs(i).IndentLevel);
}
}
}
您可以使用此方法来确定段落是否带有项目符号:
blnBullet = oShp.TextFrame.TextRange.Paragraphs(x).ParagraphFormat.Bullet
Thanks JamieG for helping out.感谢 JamieG 的帮助。 Your answer gave me hint.
你的回答给了我暗示。 Here is how I was able to solve this problem:
以下是我解决此问题的方法:
PowerPoint.BulletFormat bulletFormat = textRange.Paragraphs(x).ParagraphFormat.Bullet;
if( bulletFormat.Type == PowerPoint.PpBulletType.ppBulletNone )
// Not Bulleted
else
// Bulleted
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.