Created
January 22, 2019 22:47
-
-
Save quonic/94d67bb83925d2d9a40c17daed5fc9c4 to your computer and use it in GitHub Desktop.
Sample of how to create a PowePoint slide and get the text of a shape
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Application = New-Object -ComObject PowerPoint.Application | |
# Make PowerPoint visible during debug | |
$Application.Visible = [Microsoft.Office.Core.MsoTriState]::msoTrue | |
# Create a new presentation | |
$Application.Presentations.Add([Microsoft.Office.Core.MsoTriState]::msoTrue) | |
# Add a slide | |
# Yes... index starts at 1... | |
$Application.Presentations[1].Slides.Add(1,1) | |
# Get the text of the first shape in the first slide | |
$Application.Presentations[1].Slides[1].Shapes[1].TextFrame2.TextRange.Text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment