以下是引用菊石泽露在2007-3-10 0:41:27的发言: vba能否实现图片分割,比如4等分。 很有意思的一个问题,请参考: '* +++++++++++++++++++++++++++++ '* Created By SHOUROU@ExcelHome 2007-3-10 7:08:02 '仅测试于System: Windows NT Word: 11.0 Language: 2052 '№ 0177^The Code CopyIn [ThisDocument-ThisDocument]^' '* ----------------------------- Option Explicit
Sub FourPart() '本示例将嵌入式图片四等分 Dim myPicture As InlineShape, myRange As Range, lngEnd As Long With ActiveDocument Set myPicture = .InlineShapes(1) '定义一个嵌入式图片对象 myPicture.Range.InsertAfter Chr(13) '插入一个段落标记 '定义一个RANGE对象 Set myRange = .Range(myPicture.Range.End + 1, myPicture.Range.End + 1) myPicture.Range.Copy '复制该图片 myRange.Paste '粘贴 Set myPicture = .InlineShapes(2) '重新定义一个嵌入式图片对象,为新的粘贴后的图片 With myPicture '裁剪图片,即右侧剪掉一半,底部剪掉一半 .PictureFormat.CropRight = 50 .PictureFormat.CropBottom = 50 End With |