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
Vielen lieben Dank für Eure Mühe.
VG,
Markus
VB.NET-Quellcode
- Dim oPresentations As PowerPoint.Presentations
- Dim oApp As PowerPoint.Application
- Dim oPres As PowerPoint.Presentation
- Dim oSlide As PowerPoint.Slide
- Dim ppTextRange As PowerPoint.TextRange = Nothing
- oApp = New PowerPoint.Application()
- oApp.Visible = True
- oApp.WindowState = PowerPoint.PpWindowState.ppWindowMinimized
- oPresentations = oApp.Presentations
- oPres = oPresentations.Open(sTemplate, , , True)
- oSlide = oPres.Slides.Add(1, PowerPoint.PpSlideLayout.ppLayoutTitleOnly)
- 'Shape 1 & 2 sollen miteinander gruppiert werden
- 'Shape 1
- With oSlide.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationHorizontal, 200, 160, 50, 50)
- .TextFrame.TextRange.Font.Size = 10
- .TextFrame.TextRange.Font.Color.RGB = RGB(0, 0, 0)
- .TextFrame.TextRange.ParagraphFormat.Alignment = PowerPoint.PpParagraphAlignment.ppAlignCenter
- .Line.ForeColor.RGB = RGB(255, 0, 0)
- .Line.Visible = True
- End With
- 'Shape 2
- With oSlide.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationHorizontal, 200, 300, 94, 50)
- .TextFrame.TextRange.Font.Size = 10
- .TextFrame.TextRange.Font.Color.RGB = RGB(0, 0, 0)
- .TextFrame.TextRange.ParagraphFormat.Alignment = PowerPoint.PpParagraphAlignment.ppAlignCenter
- .Line.ForeColor.RGB = RGB(255, 0, 0)
- .Line.Visible = True
- End With