我正在获取 ppt 文件幻灯片中的所有形状现在我想从这些形状中获取文本我该怎么做
这是我的方法,我在 ppt 文件中获取所有幻灯片的形状
public void Main(string[] args)
{
// The path to the documents directory.
string dataDir = Path.GetFullPath(@"C:\Users\Vipin\Desktop\");
//Load the desired the presentation
Presentation pres = new Presentation(dataDir + "Android.ppt");
using (Presentation prestg = new Presentation(dataDir + "Android.ppt"))
{
//Accessing a slide using its slide index
int slideCount = prestg.Slides.Count();
for (int i = 0; i <= slideCount - 1; i++)
{
ISlide slide = pres.Slides[i];
foreach (IShape shap in slide.Shapes)
{
int slideCountNumber = i + 1;
float shapeHeight = shap.Frame.Height;
float shapeWidth = shap.Frame.Width;
Debug.Write("slide Number: " + slideCountNumber + " shape width = " + shapeWidth + " shapeHeight = " + shapeHeight);
}
}
}
}
现在我可以从中获取文本吗