zoukankan      html  css  js  c++  java
  • 编写Word宏使选中的图片改变为固定宽度并保持纵横比

    代码如下:

    Sub 改变图片宽度为12并设置灰色边框()
    '
    ' 改变图片宽度为12并设置灰色边框 宏
    '
    '
        ' Application.Run MacroName:="改变图片大小试验"
        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 = msoTrue
        picheight = Selection.InlineShapes(1).Height
        picwidth = Selection.InlineShapes(1).Width
        Selection.InlineShapes(1).Width = 340.15
        Selection.InlineShapes(1).Height = picheight * 340.15 / picwidth
        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#
     
        With Selection.InlineShapes(1)
            With .Borders(wdBorderLeft)
                .LineStyle = wdLineStyleSingle
                .LineWidth = wdLineWidth050pt
                .Color = -603930625
            End With
            With .Borders(wdBorderRight)
                .LineStyle = wdLineStyleSingle
                .LineWidth = wdLineWidth050pt
                .Color = -603930625
            End With
            With .Borders(wdBorderTop)
                .LineStyle = wdLineStyleSingle
                .LineWidth = wdLineWidth050pt
                .Color = -603930625
            End With
            With .Borders(wdBorderBottom)
                .LineStyle = wdLineStyleSingle
                .LineWidth = wdLineWidth050pt
                .Color = -603930625
            End With
            .Borders.Shadow = False
        End With
        With Options
            .DefaultBorderLineStyle = wdLineStyleSingle
            .DefaultBorderLineWidth = wdLineWidth050pt
            .DefaultBorderColor = -603930625
        End With   
    End Sub
  • 相关阅读:
    2:(sql语言的数据类型)
    4:关系数据库标准语言sql(sql概述:功能,特点)
    毕业设计:反射,枚举
    毕业设计:阶段性总结
    3.9易错题
    3.8(关系代数表达查询)
    3.7(附加的关系运算)
    3.5(关系的完整性约束)、(关系代数的五种基本运算:选择和投影(关于行运算和列运算的概念还不清晰))
    3.4(从E-r概念模型到关系模型即DBMS直接支持的数据模型)
    php 如何获取图片后缀和可变函数的使用实战
  • 原文地址:https://www.cnblogs.com/dongdong2016/p/6264881.html
Copyright © 2011-2022 走看看