我现在需要把整个文档的所有图片,都设定成各自原始尺寸的125%。VBA能做得到么?

解决方案 »

  1.   

    在Word中开始记录宏,手动完成所需功能,结束记录宏,按Alt+F11键,查看刚才记录的宏对应的VBA代码。
    提醒:Word查找下一幅图片的功能在滚动条右下角。
      

  2.   

    仅供参考:Application.Browser.Target = wdBrowseGraphic
        Application.Browser.Next
    Selection.InlineShapes(1).LockAspectRatio = msoTrue
        Selection.InlineShapes(1).Height = 1262.85
        Selection.InlineShapes(1).Width = 1584#
        
      

  3.   

    算了,我修改问题了。改为:如下语句为何会被提示“属性的无效使用”
    Selection.InlineShapes(1).ScaleHeight Factor:=100, RelativeToOriginalSize:=True
      

  4.   

    Factor:=100 表示比例为 10000%,太大了吧。
    比例 100% 应该是 Factor:=1.0
      

  5.   

    还有,看帮助里 InlineShape.ScaleHeight 是属性,ShapeRange.ScaleHeight 才是方法。
      

  6.   

    网上找到 ,已经测试了Sub Test()
        Dim myShape As Variant
        Application.ScreenUpdating = False
        With ActiveDocument
            For Each myShape In .Shapes
                With myShape
                    .ScaleHeight 0.5, True
                    .ScaleWidth 0.5, True
                End With
            Next
            For Each myShape In .InlineShapes
                myShape.Select
                Set myShape = .InlineShapes(1).ConvertToShape
                With myShape
                    .ScaleHeight 1.5, True, msoScaleFromMiddle
                    .ScaleWidth 1.5, True, msoScaleFromMiddle
                End With
            Next
        End With
        Application.ScreenUpdating = True
    End Sub