以下是引用crwolf在2007-12-10 22:18:59的发言:我想把我的图片一次性用VBA改为“嵌入型”,本来想录宏,但是发现录宏的时候不让选格式为嵌入型,请高手帮忙了 谢谢 给你一个超值的! '* +++++++++++++++++++++++++++++ '* Created By SHOUROU@ExcelHome 2007-12-11 5:28:26 '仅测试于System: Windows NT Word: 11.0 Language: 2052 '№ 0281^The Code CopyIn [ThisDocument-ThisDocument]^' '* ----------------------------- Option Explicit Sub 图片版式转换() Dim oShape As Variant, shapeType As WdWrapType On Error Resume Next If MsgBox("Y将图片由嵌入式转为浮动式,N将图片由浮动式转为嵌入式", 68) = 6 Then shapeType = Val(InputBox(Prompt:="请输入图片版式:0=四周型,1=紧密型, " & vbLf & _ "3=衬于文字下方,4=浮于文字上方", Default:=0)) For Each oShape In ActiveDocument.InlineShapes Set oShape = oShape.ConvertToShape With oShape Select Case shapeType Case 0, 1 .WrapFormat.Type = shapeType Case 3 .WrapFormat.Type = 3 .ZOrder 5 Case 4 .WrapFormat.Type = 3 .ZOrder 4 Case Else Exit Sub End Select .WrapFormat.AllowOverlap = False '不允许重叠 End With Next Else For Each oShape In ActiveDocument.Shapes oShape.ConvertToInlineShape Next End If End Sub '----------------------
|