共用方式為


Excel) (PictureFormat.CropBottom 屬性

傳回或設定從指定圖片或 OLE 物件底部裁剪的 數。 讀寫 Single

語法

表達。裁剪底部

傳回 PictureFormat 物件的運算式。

註解

裁剪尺寸會依據圖片的原始大小來計算。 例如,如果您插入原本高度為 100 點的圖片,請重新調整其比例,使其高度為 200 點,然後將 CropBottom 屬性設定為 50,則會從圖片底部裁剪 100 點 (而不是 50) 。

範例

這個範例會從 myDocument 上第三個圖案的底部裁去 20 點。 為使本範例正常執行,第三個圖案必須是圖片或 OLE 物件。

Set myDocument = Worksheets(1) 
myDocument.Shapes(3).PictureFormat.CropBottom = 20

使用此範例,您可以指定要從所選圖形底部裁切的百分比,而不論圖形是否已縮放。 為使本範例能正常執行,選取的圖案必須是圖片或是 OLE 物件。

percentToCrop = InputBox( _ 
 "What percentage do you want to crop off" & _ 
 " the bottom of this picture?") 
Set shapeToCrop = ActiveWindow.Selection.ShapeRange(1) 
With shapeToCrop.Duplicate 
 .ScaleHeight 1, True 
 origHeight = .Height 
 .Delete 
End With 
cropPoints = origHeight * percentToCrop / 100 
shapeToCrop.PictureFormat.CropBottom = cropPoints

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應