簡體   English   中英

將形狀從Excel調整為PowerPoint

[英]Resize shapes from excel to powerpoint

每當我將具有期望尺寸的形狀從excel粘貼到VBA時,尺寸總是會有所不同。 確切地說,是.Left部分。

這是我的代碼的簡短版本:

With PPTPres.Slides(pptcel.Offset(0, -8).Value).Shapes.Paste
    .LockAspectRatio = msoFalse
    .Align msoAlignCenters, False
    .Align msoAlignMiddles, False
    .Align msoAlignLefts, True
    .Align msoAlignTops, True
    .Height = Application.InchesToPoints(5.49)
    .Width = Application.InchesToPoints(5.12)
    .Left = Application.InchesToPoints(0.8)
End With

嘗試這樣的想法:

With PPPres.Slides(pptcel.Offset(0, -8).Value)
    .Shapes.Paste
    With .Shapes(.Shapes.Count)
        .LockAspectRatio = msoTrue
        .Left = 25
        .Top = 25
        .Height = 200
    End With
End With

相應地更改屬性設置。

暫無
暫無

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

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