4

I tried following this Presentation ML inheritance chain:

Slide <-- SlideLayout <-- SlideMaster <-- default styles in SlideMaster

to obtain x,y,width,height properties of text content in a PPT Slide but I am not sure whether I am getting correct value. Can you please tell if I am doing the right thing ? Can you also please tell me how to uniquely identify this text object in Slide, SlideLayout & SlideMaster ?

-Thank you

Taterhead
  • 5,763
  • 4
  • 31
  • 40

2 Answers2

1

Refer to the following Answer to determine the Height and Width of Text properties.

For determining if you have the right text, Enter unique text into your slide and use the Open XML Productivity Tool to find it. You can use the tool to search for your unique string in your slide and reflect the code to generate it.

Lastly, to understand the Presentation Slide XML, I recommend reading the free e-book Open XML Explained to give an explanation of how a correct Presentation document is formed to help you better understand where things should be.

Community
  • 1
  • 1
Taterhead
  • 5,763
  • 4
  • 31
  • 40
  • Thanks for your response, I looked up the details you provided. Some of my doubts are still not getting clarified, ex: for all the txBody tags x,y,cx,cy values are not available using p:ph in the slide, slideLayout & slidemaster also. For such txBody's where can this information be obtained from ? – HaveFun MediaSolutions Mar 11 '12 at 12:42
  • For an inserted Text Box, the x,y,cx,cy is located in the `p:spPr` (aka ShapeProperties) element right before the `p:txBody` element. The way to find it is to create a 1 slide presentation with a Text Box containing 'Hello' saved as File1.pptx and then move the Text Box on the slide and save this as File2.pptx. Then open both files in the Open XML Productivity Tool (via the Compare Files button) - select the slide1.xml part and then click 'View Part Diff' and then click 'next' and it will take you to the place where the slides are different. Hope this helps. – Taterhead Mar 11 '12 at 22:28
-1

If you have powerpoint installed from Microsoft office. You can do the following, though this is not programmatic, but can help you to get the job done.

Steps:

  1. Open ppt

  2. Click on your chart or whatever object you like.

  3. Right click and select or use shortcut CMD + SHIFT + 1 enter image description here

  4. Click on 3rd icons select Size Position, and you can see the following enter image description here

Note:

I'm demoing with Microsoft Powerpoint for Mac Version 2018.

Hope it helps.

Alan Dong
  • 3,981
  • 38
  • 35