
我需要一次單擊即可調整Word文件中的多個螢幕截圖的大小(增加尺寸)。
我有一個宏。下面這個就是..
Sub ResizePics()
Dim shp As Word.Shape
Dim ishp As Word.InlineShape
If Word.Selection.Type <> wdSelectionInlineShape And _
Word.Selection.Type <> wdSelectionShape Then
Exit Sub
End If
If Word.Selection.Type = wdSelectionInlineShape Then
Set ishp = Word.Selection.Range.InlineShapes(1)
ishp.LockAspectRatio = False
ishp.Height = InchesToPoints(1.78)
ishp.Width = InchesToPoints(3.17)
Else
If Word.Selection.Type = wdSelectionShape Then
Set shp = Word.Selection.ShapeRange(1)
shp.LockAspectRatio = False
shp.Height = InchesToPoints(1.78)
shp.Width = InchesToPoints(3.17)
End If
End If
End Sub
但上面的巨集僅適用於一張螢幕截圖。如果要調整所有選定影像的大小,則需要進行一些修改。
請幫我修改巨集。
答案1
我看了一下這個教學我寫了這段程式碼:
Sub ResizePics()
Dim shp As Word.Shape
Dim ishp As Word.InlineShape
For Each ishp In ActiveDocument.InlineShapes
ishp.LockAspectRatio = False
ishp.Height = InchesToPoints(1.78)
ishp.Width = InchesToPoints(3.17)
Next ishp
For Each shp In ActiveDocument.Shapes
shp.LockAspectRatio = False
shp.Height = InchesToPoints(1.78)
shp.Width = InchesToPoints(3.17)
Next shp
End Sub
我不是程式設計師,所以這只是一次嘗試:)