Foxtable(狐表)用户栏目专家坐堂 → word满屏水印


  共有3317人关注过本帖平板打印复制链接

主题:word满屏水印

帅哥哟,离线,有人找我吗?
lxhmax
  1楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:632 积分:5651 威望:0 精华:0 注册:2012/8/2 19:04:00
word满屏水印  发帖心情 Post By:2022/3/17 17:11:00 [只看该作者]

请问下老师,下面这个可以修改成满屏水印吗?

Dim app As New MSWord.Application

try
    Dim fileName = "d:\test.doc"
    Dim doc = app.Documents.Open(fileName)
    
    app.ActiveWindow.Selection.Range.Select()
    doc.Application.ActiveWindow.ActivePane.View.SeekView = MSWord.WdSeekView.wdSeekCurrentPageHeader
    app.Selection.HeaderFooter.Shapes.AddTextEffect(1, "公司绝密", "宋体", 1, False, False, 0, 0).Select
    app.Selection.ShapeRange.Name = "PowerPlusWaterMarkObject1"

    app.Selection.ShapeRange.TextEffect.NormalizedHeight = False
    app.Selection.ShapeRange.Line.Visible = False
    app.Selection.ShapeRange.Fill.Visible = True
    app.Selection.ShapeRange.Fill.Solid
    app.Selection.ShapeRange.Fill.ForeColor.RGB = RGB(192, 192, 192)
    app.Selection.ShapeRange.Fill.Transparency = 0.5
    app.Selection.ShapeRange.Rotation = 315
    app.Selection.ShapeRange.LockAspectRatio = True
    app.Selection.ShapeRange.Height = app.CentimetersToPoints(4.13)
    app.Selection.ShapeRange.Width = app.CentimetersToPoints(16.52)
    app.Selection.ShapeRange.WrapFormat.AllowOverlap = True
    app.Selection.ShapeRange.WrapFormat.Side = MSWord.WdWrapSideType.wdWrapBoth
    app.Selection.ShapeRange.WrapFormat.Type = 3
    app.Selection.ShapeRange.RelativeHorizontalPosition = MSWord.WdRelativeVerticalPosition.wdRelativeVerticalPositionMargin
    app.Selection.ShapeRange.RelativeVerticalPosition = MSWord.WdRelativeVerticalPosition.wdRelativeVerticalPositionMargin
    app.Selection.ShapeRange.Left = -999995
    app.Selection.ShapeRange.Top = -999995
    app.ActiveWindow.ActivePane.View.SeekView = MSWord.WdSeekView.wdSeekMainDocument
    doc.save
    app.Visible = True
    'app.quit
catch ex As exception
    msgbox(ex.message)
    app.quit
finally
    'app.Quit
End try

 回到顶部
总数 12 1 2 下一页