我有代码
Dim obj As Shape
i = 1
For Each obj In ActiveDocument.Shapes
ActiveDocument.Shapes.Range(i).Select
Debug.Print Selection.ShapeRange.Name
Debug.Print Selection.ShapeRange(1).OLEFormat.iconlabel
If Selection.ShapeRange(1).OLEFormat.iconlabel = "ASF_DebtorID" Then
Selection.ShapeRange(1).OLEFormat.DoVerb VerbIndex:=wdOLEVerbPrimary
Selection.WholeStory 'working on document
Selection.Copy
End If
i = i + 1
Next
它从Word级别开始工作,但当我尝试从Excel运行时,我有error 424 Object required
。
您对我如何更改代码有什么想法吗?