Hi.
I need to pick up all the text from master slides.
I tried with the following code:
Presentation presentation = new Presentation(“d:/master-slides.ppt”);
Slide slide = presentation.getMainMaster();
Shapes shapes = slide.getShapes();
for (int j = 0; j < shapes.getCount(); j++) {
Shape shape = shapes.get_Item(j);
if(!shape.isTextHolder()) {
TextFrame textFrame = shape.getTextFrame();
if (textFrame != null) System.out.println(textFrame.getText());
}
}
but it is picking up only text from MainMaster slide (and not from layout slides related to master slide). I also tried with following code:
Presentation presentation = new Presentation(“d:/master-slides.ppt”);
Slides slides = presentation.getMasters();
for (int i = 0; i < slides.getCount(); i++) {
Slide slide = slides.get_Item(i);
Shapes shapes = slide.getShapes();
for (int j = 0; j < shapes.getCount(); j++) {
Shape shape = shapes.get_Item(j);
if (!shape.isTextHolder()) {
TextFrame textFrame = shape.getTextFrame();
if (textFrame != null)
System.out.println("From " + (i + 1) + ". slide: "
+ textFrame.getText());
}
}
}
and it is picking up text from MainMaster slide and layout slides related to it but for every layout slide it prints every textbox inherited from MainMaster slide. This duplicates this kind of text. Can you tell me how to pick up all the text from master slides but not to duplicate text from layout slides that is inherited from MainMaster slide?
Thanks,
Slavko