PowerPoint Shapes gruppieren - Windows Forms Anwendung

  • PowerPoint

    PowerPoint Shapes gruppieren - Windows Forms Anwendung

    Ich möchte gerne PowerPoint Shapes z.B. „Textboxen“ miteinander gruppieren. Leider habe ich bisher nicht herausfinden können wie das funktioniert (range, group…). Ich vermute ich muss den jeweiligen Shapes erst einen Namen geben „SET“ funktioniert leider nicht mehr. Für ein kleines Beispiel mit z.B. 2 Textbox Shapes wäre ich sehr dankbar.

    Vielen lieben Dank für Eure Mühe.

    VG,
    Markus

    VB.NET-Quellcode

    1. Dim oPresentations As PowerPoint.Presentations
    2. Dim oApp As PowerPoint.Application
    3. Dim oPres As PowerPoint.Presentation
    4. Dim oSlide As PowerPoint.Slide
    5. Dim ppTextRange As PowerPoint.TextRange = Nothing
    6. oApp = New PowerPoint.Application()
    7. oApp.Visible = True
    8. oApp.WindowState = PowerPoint.PpWindowState.ppWindowMinimized
    9. oPresentations = oApp.Presentations
    10. oPres = oPresentations.Open(sTemplate, , , True)
    11. oSlide = oPres.Slides.Add(1, PowerPoint.PpSlideLayout.ppLayoutTitleOnly)
    12. 'Shape 1 & 2 sollen miteinander gruppiert werden
    13. 'Shape 1
    14. With oSlide.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationHorizontal, 200, 160, 50, 50)
    15. .TextFrame.TextRange.Font.Size = 10
    16. .TextFrame.TextRange.Font.Color.RGB = RGB(0, 0, 0)
    17. .TextFrame.TextRange.ParagraphFormat.Alignment = PowerPoint.PpParagraphAlignment.ppAlignCenter
    18. .Line.ForeColor.RGB = RGB(255, 0, 0)
    19. .Line.Visible = True
    20. End With
    21. 'Shape 2
    22. With oSlide.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationHorizontal, 200, 300, 94, 50)
    23. .TextFrame.TextRange.Font.Size = 10
    24. .TextFrame.TextRange.Font.Color.RGB = RGB(0, 0, 0)
    25. .TextFrame.TextRange.ParagraphFormat.Alignment = PowerPoint.PpParagraphAlignment.ppAlignCenter
    26. .Line.ForeColor.RGB = RGB(255, 0, 0)
    27. .Line.Visible = True
    28. End With