请问有谁知道怎么用C++给一个word文档添加水印嘛?
我看VBA宏的做法是在HeaderFooter的属性Shapse中使用方法AddPicture,
但把这段VBA宏转成C++语言就不知道怎么写了,
不知道里面的参数怎么填写,求大佬告诉!
VBA宏代码如下——
Sub 宏1()
'
' 宏1 宏
'
'
ActiveDocument.Sections(1).Range.Select
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.Shapes.AddPicture(FileName:= _
"C:\Users\Administrator\Pictures\2016-10-30\001.jpg", LinkToFile:=False, _
SaveWithDocument:=True).Select
Selection.ShapeRange.Name = "WordPictureWatermark196080593"
Selection.ShapeRange.PictureFormat.Brightness = 0.85
Selection.ShapeRange.PictureFormat.Contrast = 0.15
Selection.ShapeRange.LockAspectRatio = True
Selection.ShapeRange.Height = CentimetersToPoints(21.44)
Selection.ShapeRange.Width = CentimetersToPoints(14.65)
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