我必须打印邮资标签作为我在线业务的一部分。我有一个宏来定位页面中的标签,但我想要一种方法将图像移动到另一页。
如何使用VBA宏将我拥有的20张图像移动到5个单独的页面上,每张图片上有4张图像?顺便说一句,这是mac。感谢。
Sub ImageResize()
'
' ImageResize Macro
' Resizes all images to a height of approx 99px
'
Dim i As Long
With ActiveDocument
For i = 1 To .Shapes.Count
With .Shapes(i)
.Height = 300
End With
Next i
End With
End Sub
Sub ImagePos()
'
' ImagePos Macro
' Positions 4 images per page.
Dim i As Long
With ActiveDocument
For i = 1 To .Shapes.Count
With .Shapes(i)
.Top = (i Mod 2) * 400
If i Mod 4 = 3 Or i Mod 4 = 0 Then
.Left = 250
End If
Selection.InsertBreak Type:=wdPageBreak
End With
Next i
End With
End Sub
答案 0 :(得分:0)
再创建一个Sub
,为您的每个网页调用ImageResize
和ImagePos
个潜点。
Sub PicOnPages()
Dim p As Page
For Each p In ActiveDocument.ActiveWindow.Panes(1).Pages
ImageResize
ImagePos
Next
End Sub
希望这有帮助!