|
楼主 |
发表于 2023-3-21 07:55
|
显示全部楼层
你会不会啊,我的程序在这里。你的程序倒什么都没有。
- Sub test1()
- Set mydoc = ActiveDocument
- Set shp1 = mydoc.Shapes.AddShape(msoShapeOval, 200, 100, 100, 100) '1插入第1个圆
- Set shp2 = mydoc.Shapes.AddShape(msoShapeOval, 250, 100, 100, 100) '2插入第2个圆
- Set shp3 = mydoc.Shapes.AddShape(msoShapeOval, 225, 150, 100, 100) '3插入第3个圆
- With shp3
- .Fill.Patterned msoPatternDarkDownwardDiagonal
- '设置图片格式 --填充颜色 - -填充效果 - -图案
- '.ZOrder msoSendToBack '置于底层
- '.ZOrder msoBringToFront '置于顶层
- .ZOrder msoSendBackward '下移一层
- End With
- With shp1
- '.Line.Weight = 1.25 '2线型0.75--1.25
- .Fill.Transparency = 0.99 '透明度
- .ZOrder msoBringForward '上移一层
- End With
- With shp2
- '.Line.Weight = 1.25 '2线型0.75--1.25
- .Fill.Transparency = 0.99 '透明度
- .ZOrder msoBringForward '上移一层
- End With
- mydoc.Shapes.Range(Array(shp1.Name, shp2.Name, shp3.Name)).Select '选择3个圆
- Selection.Copy
- Selection.PasteSpecial DataType:=wdPasteEnhancedMetafile '增强型图元文件
- mydoc.Shapes(mydoc.Shapes.Count).Select
- Selection.ShapeRange.PictureFormat.CropBottom = CentimetersToPoints(3.32) '自上向下剪裁
- shp1.Delete: shp2.Delete: shp3.Delete:
- Set shp4 = mydoc.Shapes(mydoc.Shapes.Count)
-
- Set shp6 = mydoc.Shapes.AddShape(msoShapeOval, 250, 100, 100, 100) '2插入第5个圆
- With shp6
- .Fill.Patterned msoPatternDarkDownwardDiagonal
- .ZOrder msoSendToBack '置于底层
- End With
- Set shp5 = mydoc.Shapes.AddShape(msoShapeOval, 200, 100, 100, 100) '1插入第4个圆
- With shp5
- .Fill.Transparency = 1 '透明度
- .ZOrder msoBringForward '上移一层
- End With
- Set shp7 = mydoc.Shapes.AddShape(msoShapeOval, 225, 150, 100, 100) '3插入第6个圆
- With shp7
- .Fill.Transparency = 1 '透明度
- .ZOrder msoBringForward '上移一层
- End With
-
- mydoc.Shapes.Range(Array(shp5.Name, shp6.Name, shp7.Name)).Select '选择3个圆
- Selection.Copy
-
- Selection.PasteSpecial DataType:=wdPasteEnhancedMetafile '增强型图元文件
- shp5.Delete: shp6.Delete: shp7.Delete
- mydoc.Shapes(mydoc.Shapes.Count).Select
- Selection.ShapeRange.PictureFormat.CropTop = CentimetersToPoints(1.95) '自上向下剪裁
- Selection.ShapeRange.PictureFormat.CropRight = CentimetersToPoints(2.66) '自右向左剪裁
- Set shp8 = mydoc.Shapes(mydoc.Shapes.Count)
- Selection.Copy
- Selection.PasteSpecial DataType:=wdPasteEnhancedMetafile '增强型图元文件
-
- Set shp9 = mydoc.Shapes(mydoc.Shapes.Count)
- shp9.Select
- Selection.ShapeRange.Flip msoFlipHorizontal '水平翻转
- mydoc.Shapes.Range(Array(shp4.Name, shp8.Name, shp9.Name)).Select '选择3个
-
- Selection.ShapeRange.IncrementTop 100
- shp9.Select
- Selection.ShapeRange.IncrementTop 52.4
- Selection.ShapeRange.IncrementLeft 75.6
-
-
- ActiveDocument.Shapes.Range(Array(shp4.Name, shp8.Name, shp9.Name)).Group
- End Sub
复制代码
Word2003,文件里有,看看吧。
就是调不准上下左右的粘贴距离。
|
-
|