如何将图像粘贴到 PowerPoint 中

How to paste images into PowerPoint

我已将一张图像复制到剪贴板,并想使用 Microsoft powershell 将该图像粘贴到幻灯片中。

使用PasteSpecial method

这是一个使用新的空白演示文稿的示例,将剪贴板中的任何内容粘贴到新幻灯片中:

# Open PowerPoint
$PowerPoint = New-Object -ComObject PowerPoint.Application

# Create a new presentation
$Presentation = $PowerPoint.Presentations.Add($false)

# Create a new title slide
$Slide = $Presentation.Slides.Add(1,11)

# Paste contents of clipboard to slide
$Pasted = $Slide.Shapes.PasteSpecial(0,$false,$null,$null,$null,$null)

$Pasted 将包含对您刚刚粘贴的图像的范围引用