==========================
Sub 图片后加回车()
Dim s As Shape
Dim pg As Paragraph
'先将图片批量转换为嵌入型
For Each s In ActiveDocument.Shapes
With s
If s.Type = msoPicture Then
s.ConvertToInlineShape
End If
End With
Next s
'遍历所有段落
For Each pg In ActiveDocument.Paragraphs
'计算段落内的图片数量
pgCount = pg.Range.InlineShapes.Count
If pgCount > 0 Then
With pg
.Range.Select
Selection.MoveUp unit:=wdParagraph, Extend:=wdMove
Selection.MoveRight unit:=wdCharacter, Count:=1, Extend:=wdMove
Selection.InsertAfter Chr(13)
End With
End If
Next pg
End Sub
==========================
Sub 批量设置图片大小()
Dim n, m
Dim blnisinlineshape As Boolean
Dim mylineshape As InlineShape
On Error Resume Next '忽略错误
m = ActiveDocument.InlineShapes.Count
For n = 1 To 2 'inlineshapes类型的图片
ActiveDocument.InlineShapes(n).LockAspectRatio = msoFalse '不锁定图片的纵横比
ActiveDocument.InlineShapes(n).Height = 153 '设置图片高度为 243px
ActiveDocument.InlineShapes(n).Width = 243 '设置图片高度为153px
Next n
For n = 1 To 2 'inlineshapes类型的图片
ActiveDocument.Shapes(n).LockAspectRatio = msoFalse '不锁定图片的纵横比
ActiveDocument.Shapes(n).Height = 153 '设置图片高度为 153px
ActiveDocument.Shapes(n).Width = 243 '设置图片高度为243px
Next n
For n = 3 To m 'inlineshapes类型的图片
ActiveDocument.InlineShapes(n).LockAspectRatio = msoFalse '不锁定图片的纵横比
ActiveDocument.InlineShapes(n).Height = 297 '设置图片高度为 297px
ActiveDocument.InlineShapes(n).Width = 405 '设置图片高度为405px
Next n
For n = 3 To m 'inlineshapes类型的图片
ActiveDocument.Shapes(n).LockAspectRatio = msoFalse '不锁定图片的纵横比
ActiveDocument.Shapes(n).Height = 297 '设置图片高度为 297px
ActiveDocument.Shapes(n).Width = 405 '设置图片高度为405px
Next n
With Selection.ParagraphFormat
.LeftIndent = CentimetersToPoints(0)
.RightIndent = CentimetersToPoints(0)
.SpaceBefore = 50
.SpaceBeforeAuto = False
.SpaceAfter = 50
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceMultiple
.LineSpacing = LinesToPoints(3)
.Alignment = wdAlignParagraphCenter
.WidowControl = False
.KeepWithNext = False
.KeepTogether = False
.PageBreakBefore = False
.NoLineNumber = False
.Hyphenation = True
.FirstLineIndent = CentimetersToPoints(0)
.OutlineLevel = wdOutlineLevelBodyText
.CharacterUnitLeftIndent = 0
.CharacterUnitRightIndent = 0
.CharacterUnitFirstLineIndent = 0
.LineUnitBefore = 10
.LineUnitAfter = 10
.MirrorIndents = False
.TextboxTightWrap = wdTightNone
.AutoAdjustRightIndent = True
.DisableLineHeightGrid = False
.FarEastLineBreakControl = True
.WordWrap = True
.HangingPunctuation = True
.HalfWidthPunctuationOnTopOfLine = False
.AddSpaceBetweenFarEastAndAlpha = True
.AddSpaceBetweenFarEastAndDigit = True
.BaseLineAlignment = wdBaselineAlignAuto
End With
End Sub
==========================
==========================
==========================
==========================
==========================
==========================
==========================
==========================
==========================
==========================