以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]WORD水印  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=69160)

--  作者:wusim
--  发布时间:2015/5/31 21:32:00
--  [求助]WORD水印
怎样能够将一字段内容作为水印内容加入WORD报表内。
--  作者:大红袍
--  发布时间: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


--  作者:liufucan
--  发布时间:2018/6/14 21:28:00
--  
能做到批量生成水印为001到020共20页的水印吗?每页内容都一样
--  作者:有点甜
--  发布时间:2018/6/14 22:29:00
--  

2楼的不是每页都有水印么?不理解你的意思。

 

 


--  作者:liufucan
--  发布时间:2018/6/14 22:34:00
--  
我要的水印内容不是公司绝密而是001到020每页的水印不一样
--  作者:有点甜
--  发布时间:2018/6/14 22:52:00
--  
以下是引用liufucan在2018/6/14 22:34:00的发言:
我要的水印内容不是公司绝密而是001到020每页的水印不一样

 

1、水印都是一模一样的,你是不是对水印有什么误解?

 

2、你是不是要设置页眉?第一页显示01,第二页显示02,第三页显示03?


--  作者:liufucan
--  发布时间:2018/6/14 23:08:00
--  
我知道设置一次水印都是一样的,准确的说我是想要一次性批量生成20个带水印的word再拼接成一个文件
--  作者:有点甜
--  发布时间:2018/6/14 23:24:00
--  
以下是引用liufucan在2018/6/14 23:08:00的发言:
我知道设置一次水印都是一样的,准确的说我是想要一次性批量生成20个带水印的word再拼接成一个文件

 

拷贝粘贴

 

http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=99542&skin=0

 


--  作者:liufucan
--  发布时间:2018/6/15 19:05:00
--  
怎么让水印横行居中显示,不要斜体呢
--  作者:有点蓝
--  发布时间:2018/6/15 20:02:00
--  
自己改改这几个属性的值,看效果

app.Selection.ShapeRange.Fill.Transparency = 0.5 \'透明度
    app.Selection.ShapeRange.Rotation = 315 \'角度
    app.Selection.ShapeRange.LockAspectRatio = True