簡體   English   中英

在 PowerPoint 中粘貼圖像(excel 表格)

[英]Pasting images (excel Table) in PowerPoint

我正在嘗試通過 VBA 將 excel 表格作為圖片粘貼到 PPT 中,但圖像不是編碼所需的形狀

要求坐標是:

Height 14.80
Width 23.28
Top 2.13
Left 5.3

output 坐標如下:

H-18.73 CM
W-23.28 CM
Horizontal-5.3 CM
Vertical-2.13

下面是我的代碼:

Range(cel.Value).Copy
newPowerPoint.ActiveWindow.View.GotoSlide cel.Offset(0, -1).Value
Set activeSlide = newPowerPoint.ActivePresentation.Slides(cel.Offset(0, -1).Value)
activeSlide.Shapes.PasteSpecial(DataType:=ppPasteEnhancedMetafile).Select
newPowerPoint.ActiveWindow.Selection.ShapeRange.Height = Application.CentimetersToPoints(14.80)
newPowerPoint.ActiveWindow.Selection.ShapeRange.Width = Application.CentimetersToPoints(23.28)
newPowerPoint.ActiveWindow.Selection.ShapeRange.Left = Application.CentimetersToPoints(2.13)
newPowerPoint.ActiveWindow.Selection.ShapeRange.Top = Application.CentimetersToPoints(5.3) 

好的解決方法是將形狀放置在您想要的位置並使用 Debug.print 以點為單位讀取 position。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM