WORD文档中插入图片(1)
(转)
在WORD文档中插入图片有两种方法:一种是添加到文档的文本层(嵌入型版式);一种是添加到文档的图形层(其他版式)。
文本层的图片是不可以设置版式的,而图形层的版式是可以设置的,但只能是以图形层的方式,不可以是嵌入式的。
下面的代码是将一个四周型的版式改为浮于文字上方的宏:
Sub Macro3()
'
'
'
'
Selection.ShapeRange.LockAspectRatio = msoTrue
Selection.ShapeRange.Height = 96.1
Selection.ShapeRange.Width = 96.1
Selection.ShapeRange.PictureFormat.Brightness = 0.5
Selection.ShapeRange.PictureFormat.Contrast = 0.5
Selection.ShapeRange.PictureFormat.ColorType = msoPictureAutomatic
Selection.ShapeRange.PictureFormat.CropLeft = 0#
Selection.ShapeRange.PictureFormat.CropRight = 0#
Selection.ShapeRange.PictureFormat.CropTop = 0#
Selection.ShapeRange.PictureFormat.CropBottom = 0#
Selection.ShapeRange.RelativeHorizontalPosition = _
wdRelativeHorizontalPositionColumn
Selection.ShapeRange.RelativeVerticalPosition = _
wdRelativeVerticalPositionParagraph
Selection.ShapeRange.Left = wdShapeCenter
Selection.ShapeRange.Top = CentimetersToPoints(0)
Selection.ShapeRange.LockAnchor = False
Selection.ShapeRange.WrapFormat.AllowOverlap = True
Selection.ShapeRange.WrapFormat.Side = wdWrapBoth
Selection.ShapeRange.WrapFormat.DistanceTop = CentimetersToPoints(0)
Selection.ShapeRange.WrapFormat.DistanceBottom = CentimetersToPoints(0)
Selection.ShapeRange.WrapFormat.DistanceLeft = CentimetersToPoints(0.32)
Selection.ShapeRange.WrapFormat.DistanceRight = CentimetersToPoints(0.32)
Selection.ShapeRange.WrapFormat.Type = wdWrapTight
Selection.ShapeRange.IncrementLeft -105.55
Selection.ShapeRange.IncrementTop 150#
End Sub