使用Interop.Word在Word文档中对AutoShape进行分组

时间:2011-08-20 06:16:44

标签: c# office-interop

我尝试使用C#语言中的Interop.Word 12.0在Word中绘制AutoShape。我在文档中有一些AutoShape对象。如何使用Interop.Word 12.0对AutoShapes进行分组?

有一种方法可以使用VBA对AutoShape对象进行分组,但现在有一种方法不存在(document.Shapes.get_Range(...))。

1 个答案:

答案 0 :(得分:-1)

 ActiveDocument.Shapes.AddShape(msoShapeRectangle, 80.25, 478.5, 39#, _
        61.5).Select
    ActiveDocument.Shapes.AddShape(msoShapeOval, 131.25, 487.5, 71.25, 48.75) _
        .Select
    ActiveDocument.Shapes.Range(Array("Oval 9", "Rectangle 8")).Select
    Selection.ShapeRange.Group.Select

阅读上面的宏