locked
Extracting Powerpoint Objects in vba RRS feed

  • Question

  • In VBA, I want to loop through all shapes in all slides in a Powerpoint presentation extracting their details and creating an xml file that can be read by another application.

    I'm stuck on the line shape. The properties .left .top .height and .width give me the rectangular bounds of the line but don't tell me if the line is angled bottom-left to top-right or top-left to bottom-right, i.e. does it slope upwards or downwards.

    Does someone know how I get this information please? Which property has this and what do its values mean?

    Peter

    Saturday, November 26, 2011 8:34 PM

Answers

  • Hello Peter,

    Select a line and check its VerticalFlip property:

    Sub test()
    Dim sel As PowerPoint.Selection
    Set sel = PowerPoint.ActiveWindow.Selection
    Debug.Print sel.ShapeRange.Item(1).VerticalFlip
    End Sub
    

    Is that it?


    Regards from Belarus (GMT + 3),

    Andrei Smolin
    Add-in Express Team Leader
    • Proposed as answer by Calvin_Gao Monday, November 28, 2011 8:58 AM
    • Marked as answer by Calvin_Gao Wednesday, December 7, 2011 10:15 AM
    Saturday, November 26, 2011 9:06 PM

All replies

  • Hello Peter,

    Select a line and check its VerticalFlip property:

    Sub test()
    Dim sel As PowerPoint.Selection
    Set sel = PowerPoint.ActiveWindow.Selection
    Debug.Print sel.ShapeRange.Item(1).VerticalFlip
    End Sub
    

    Is that it?


    Regards from Belarus (GMT + 3),

    Andrei Smolin
    Add-in Express Team Leader
    • Proposed as answer by Calvin_Gao Monday, November 28, 2011 8:58 AM
    • Marked as answer by Calvin_Gao Wednesday, December 7, 2011 10:15 AM
    Saturday, November 26, 2011 9:06 PM
  • Hello Andrei,

    I think that's it - thank you very much.

    Text boxes next and they are sure to raise some questions.

    Thanks again,

    Peter (GMT + 0)

    Saturday, November 26, 2011 10:06 PM