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