![]() |
|
#1
|
|||
|
|||
|
Helloo,
I tried to insert watermarks in the middle of every page in a document with several sections and it worked (Code is below). But when there's a table in the header then the watermark gets not placed in the middle of the page but elsewhere. Does anyone know why? Thx and BR, shu Code:
Dim wassZ1 As Shape
Dim i As Long
For i = 1 To ActiveDocument.Sections.Count
With ActiveDocument.Sections(i).Headers(wdHeaderFooterPrimary).Range
'Überprüfen ob schon ein WZ vorhanden ist, wenn ja dann löschen
If .ShapeRange.Count > 0 Then
.ShapeRange(1).Delete
End If
End With
'neues Wasserzeichen einfügen
With ActiveDocument.Sections(i)
Set wassZ1 = .Headers(wdHeaderFooterPrimary).Shapes.AddTextEffect(PresetTextEffect:=msoTextEffect2, _
Text:="DRAFT1", FontName:="Arial", FontSize:=36, FontBold:=msoTrue, FontItalic:=msoFalse, _
Left:=1, Top:=1)
End With
With wassZ1
.Fill.Visible = msoTrue
.Fill.Solid
.Fill.ForeColor.RGB = RGB(192, 192, 192)
.Fill.Transparency = 0.5
.Line.Weight = 0.75
.Line.DashStyle = msoLineSolid
.Line.Style = msoLineSingle
.Line.Transparency = 0
.Line.Visible = msoFalse
.LockAspectRatio = msoFalse
.Rotation = 330
.Height = CentimetersToPoints(8)
.Width = CentimetersToPoints(15)
.RelativeHorizontalPosition = _
wdRelativeHorizontalPositionMargin
.RelativeVerticalPosition = _
wdRelativeVerticalPositionMargin
.RelativeHorizontalSize = wdRelativeHorizontalSizePage
.RelativeVerticalSize = wdRelativeVerticalSizePage
.Left = wdShapeCenter
.LeftRelative = wdShapePositionRelativeNone
.Top = wdShapeCenter
.TopRelative = wdShapePositionRelativeNone
.WidthRelative = wdShapeSizeReativeNone
.HeightRelative = wdShapeSizeRelativeNone
'Vali docs
'.IncrementLeft 120
'.IncrementTop 280
End With
Next I
Last edited by macropod; 09-24-2018 at 05:07 PM. Reason: Added code tags |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Watermarks
|
PomDave | Word | 1 | 08-04-2018 05:45 PM |
Watermarks
|
gamiezio | Word | 5 | 08-18-2017 09:23 AM |
| Inserting section between existing sections | GoneBirding | Word | 0 | 10-18-2012 03:01 PM |
Clipart and Watermarks
|
Maureen | Office | 3 | 09-30-2011 02:53 AM |
| Watermarks on the web | David S | Word | 0 | 07-28-2011 07:54 AM |