1

我创建了 2 个形状(文本框),然后我想摸索它。形状已选择但未分组。我不知道该怎么做...

这是我的代码

        Word.Application wordapp = new Word.Application();
        Word.Document doc = wordapp.Documents.Add();
        wordapp.Visible = true;

        Word.Shape shNum1 = doc.Shapes.AddTextbox(MsoTextOrientation.msoTextOrientationHorizontal, 100, 100, 10, 10);
        shNum1.TextFrame.TextRange.Text = "123";
        Word.Shape shNum2 = doc.Shapes.AddTextbox(MsoTextOrientation.msoTextOrientationHorizontal, 150, 150, 10, 10);
        shNum2.TextFrame.TextRange.Text = "321";

        doc.Shapes.SelectAll();
        wordapp.Selection.ShapeRange.Group();
4

0 回答 0