zoukankan      html  css  js  c++  java
  • word宏 加水印

    word加水印的宏代码:不是加载页眉或者页脚,是加在正文中,但是加在正文成功后,只能在当前页插入水印,如果实现每页都插入水印

    Sub water()
    '
    ' water 宏
    ' 添加水印
    '
     ActiveDocument.Sections(1).Range.Select
        ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
        Selection.HeaderFooter.Shapes.AddTextEffect(1, _
            "作废", "宋体", 1, False, False, 0, 0).Select
      
        Selection.ShapeRange.TextEffect.NormalizedHeight = False
        Selection.ShapeRange.Line.Visible = False
        Selection.ShapeRange.Fill.Visible = True
        Selection.ShapeRange.Fill.Solid
        Selection.ShapeRange.Fill.ForeColor.RGB = -603923969
        Selection.ShapeRange.Fill.Transparency = 0.5
        Selection.ShapeRange.Rotation = 30
        Selection.ShapeRange.LockAspectRatio = True
        Selection.ShapeRange.Height = CentimetersToPoints(2.58)
        Selection.ShapeRange.Width = CentimetersToPoints(4.07)
        Selection.ShapeRange.WrapFormat.AllowOverlap = True
        Selection.ShapeRange.WrapFormat.Side = wdWrapNone
        Selection.ShapeRange.WrapFormat.Type = 3
        Selection.ShapeRange.RelativeHorizontalPosition = _
            wdRelativeVerticalPositionMargin
        Selection.ShapeRange.RelativeVerticalPosition = _
            wdRelativeVerticalPositionMargin
        Selection.ShapeRange.Left = wdShapeCenter
        Selection.ShapeRange.Top = wdShapeCenter
        ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument


    End Sub

    这个是加载在页眉。

    Sub water()
    '
    ' water 宏
    ' 添加水印
    '
     ActiveDocument.Sections(1).Range.Select
        ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
       
        Selection.Document.Shapes.AddTextEffect(1, _
            "作废", "宋体", 1, False, False, 0, 0).Select
      
        Selection.ShapeRange.TextEffect.NormalizedHeight = False
        Selection.ShapeRange.Line.Visible = False
        Selection.ShapeRange.Fill.Visible = True
        Selection.ShapeRange.Fill.Solid
        Selection.ShapeRange.Fill.ForeColor.RGB = -603923969
        Selection.ShapeRange.Fill.Transparency = 0.5
        Selection.ShapeRange.Rotation = 30
        Selection.ShapeRange.LockAspectRatio = True
        Selection.ShapeRange.Height = CentimetersToPoints(2.58)
        Selection.ShapeRange.Width = CentimetersToPoints(4.07)
        Selection.ShapeRange.WrapFormat.AllowOverlap = True
        Selection.ShapeRange.WrapFormat.Side = wdWrapNone
        Selection.ShapeRange.WrapFormat.Type = 3
        Selection.ShapeRange.RelativeHorizontalPosition = _
            wdRelativeVerticalPositionMargin
        Selection.ShapeRange.RelativeVerticalPosition = _
            wdRelativeVerticalPositionMargin
        Selection.ShapeRange.Left = wdShapeCenter
        Selection.ShapeRange.Top = wdShapeCenter
        ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
    End Sub

    这个是加载在正文中,但是不能实现加载每页

  • 相关阅读:
    Supermap全面接触
    期末小结(二).应用技术
    发展需要大师,繁荣更需批评——GIS现状堪忧
    期末小结(三).我是玻璃缸里的鱼
    地信空间数据库实习讲稿(Oracle spatial)
    .net会取代JavaScript
    空间聚类(等回来之后完成)
    .Net Windows服务安装完成后自动启动
    规划网站,本教程将以图示为例构建网站;
    漫谈CSS和页面布局
  • 原文地址:https://www.cnblogs.com/hack1506/p/1905352.html
Copyright © 2011-2022 走看看