VB 如何控制WORD中插入图片的大小等属性?

VB 如何控制WORD中插入图片的大小等属性?,第1张

自己录个宏,稍加改动就可以了。

Sub 图片旋转270度对齐页面()

'图片排版270度

If Selection.InlineShapes.Count = 0 Then

If Selection.ShapeRange.Count <>0 Then

Selection.ShapeRange.Fill.Visible = msoFalse

'Selection.ShapeRange.AlternativeText = "Higer标书工具修改"

Selection.ShapeRange.Fill.Solid

Selection.ShapeRange.Fill.Transparency = 0#

Selection.ShapeRange.Line.Weight = 0.75

Selection.ShapeRange.Line.DashStyle = msoLineSolid

Selection.ShapeRange.Line.Style = msoLineSingle

Selection.ShapeRange.Line.Transparency = 0#

Selection.ShapeRange.Line.Visible = msoFalse

Selection.ShapeRange.LockAspectRatio = msoFalse

Selection.ShapeRange.Rotation = 270#

Selection.ShapeRange.Width = CentimetersToPoints(28.9)

Selection.ShapeRange.Height = CentimetersToPoints(20.2)

'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.Left = 90.1

'Selection.ShapeRange.Top = 88.15

'Selection.ShapeRange.Left = -120.45

'Selection.ShapeRange.Top = 109.1

Selection.ShapeRange.RelativeHorizontalPosition = _

wdRelativeHorizontalPositionPage

Selection.ShapeRange.RelativeVerticalPosition = _

wdRelativeVerticalPositionPage

Selection.ShapeRange.Left = wdShapeCenter

Selection.ShapeRange.Top = wdShapeCenter

Selection.ShapeRange.LockAnchor = False

Selection.ShapeRange.LayoutInCell = True

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 = 3

Selection.ShapeRange.ZOrder 4

Selection.ShapeRange.ZOrder msoSendBackward

End If

End If

If Selection <>"" Then

If Selection.InlineShapes.Count <>0 Then

'Selection.InlineShapes(1).Fill.Visible = msoFalse

'Selection.InlineShapes(1).Fill.Solid

'Selection.InlineShapes(1).Fill.Transparency = 0#

'Selection.InlineShapes(1).Line.Weight = 0.75

'Selection.InlineShapes(1).Line.Transparency = 0#

'Selection.InlineShapes(1).Line.Visible = msoFalse

'Selection.InlineShapes(1).LockAspectRatio = msoFalse

'Selection.InlineShapes(1).Width = CentimetersToPoints(28.9)

'Selection.InlineShapes(1).Height = CentimetersToPoints(20.2)

'Selection.InlineShapes(1).PictureFormat.Brightness = 0.5

'Selection.InlineShapes(1).PictureFormat.Contrast = 0.5

'Selection.InlineShapes(1).PictureFormat.ColorType = msoPictureAutomatic

'Selection.InlineShapes(1).PictureFormat.CropLeft = 0#

'Selection.InlineShapes(1).PictureFormat.CropRight = 0#

'Selection.InlineShapes(1).PictureFormat.CropTop = 0#

'Selection.InlineShapes(1).PictureFormat.CropBottom = 0#

Selection.InlineShapes(1).ConvertToShape '属性转换(InlineShapes(1)转换为ShapeRange)

Selection.ShapeRange.Fill.Visible = msoFalse

'Selection.ShapeRange.AlternativeText = "Higer标书工具修改"

Selection.ShapeRange.Fill.Solid

Selection.ShapeRange.Fill.Transparency = 0#

Selection.ShapeRange.Line.Weight = 0.75

Selection.ShapeRange.Line.DashStyle = msoLineSolid

Selection.ShapeRange.Line.Style = msoLineSingle

Selection.ShapeRange.Line.Transparency = 0#

Selection.ShapeRange.Line.Visible = msoFalse

Selection.ShapeRange.LockAspectRatio = msoFalse

Selection.ShapeRange.Width = CentimetersToPoints(28.9)

Selection.ShapeRange.Height = CentimetersToPoints(20.2)

Selection.ShapeRange.Rotation = 270#

'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 = _

wdRelativeHorizontalPositionPage

Selection.ShapeRange.RelativeVerticalPosition = _

wdRelativeVerticalPositionPage

Selection.ShapeRange.Left = wdShapeCenter

Selection.ShapeRange.Top = wdShapeCenter

Selection.ShapeRange.LockAnchor = False

Selection.ShapeRange.LayoutInCell = True

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 = 3

Selection.ShapeRange.ZOrder 4

Selection.ShapeRange.ZOrder msoSendBackward

End If

End If

End Sub

1、首先打开word文档,然后插入几张大小不一的图片。

2、然后,选中一张图片,右击鼠标,选择 其他布局选项。

3、然后会d出菜单,布局设置,点开大小。

4、然后我们把 锁定纵横比 前面的√去掉,再高度和宽度的大小改成你要的数据。

5、以上设置完之后,确定回到word文档,就可以看到图片变成你想要的大小了。

1、首先我们打开Word文档,点击主菜单中的“插入”,在其子项中选择“图片”选项并单击,这时会出现“插入图片”对话窗。

2、接着在对话窗中我们选中需要插入到文档中的所有图片,再点击“插入”按钮,这样图片就插入到文档中了。

3、然后我们选中其中的一个图片,单击鼠标右键,在扩展项中选择“大小和位置”选项,这时就会出现图片大小设置的对话窗。

4、在图片大小对话窗中,我们先取消“锁定纵横比”选项,然后修改图片的高度和宽度数值,再点击“确定”按钮,这样选中图片的尺寸就被改变了。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/bake/11931233.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-19
下一篇 2023-05-19

发表评论

登录后才能评论

评论列表(0条)

保存