Foxtable(狐表)用户栏目专家坐堂 → [求助]WORD水印


  共有3404人关注过本帖树形打印复制链接

主题:[求助]WORD水印

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/5/31 22:42:00 [显示全部帖子]

mark word水印

 

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


 回到顶部