分组所有形状VBA excel / Word
我创build的macros允许我从特定path打开单词,然后在该ActiveDocument
中的不同区域中定位不同的形状我想要的是当打开单词完成和修改形状也完成该活动文档中的所有形状分组在一起这我的代码打开字
Dim wrdApp As Word.Application Dim wrdDoc As Word.Document Dim shp As Object Set wrdApp = CreateObject("Word.Application") wrdApp.Visible = True Set wrdDoc = wrdApp.Documents.Open(Sheets("Path").Range("B2").Value) With wrdDoc
这是分组的代码
wrdDoc.ActiveDocument.Shapes.SelectAll Selection.ShapeRange.Group
我没有成功适应它,一个错误正在向我展示
excel的东西误导了我,你应该提到你从工作表中获取文件名
wrdDoc
是一个文档对象。 ActiveDocument
也是一个文档对象
wrdDoc.ActiveDocument
就像是说ActiveDocument.ActiveDocument
…这是不好的
只需使用wrdDoc.Shapes.SelectAll
或ActiveDocument.Shapes.SelectAll
感谢所有帮助我的人
解决了我的一些想法之后的问题
wrdDoc.Shapes.Range(Array("Groupe 19", "Group 646", "Image 652", "Group643", "Image 1", "Text Box 642", "Zone de texte 2")).Group
:D祝你有美好的一天