G
G. Harland
I have a Word document with nine sections. None of the sections are linked
because there is specific text in each header.
From an Access database, I have code that opens the Word document, replaces
a bunch of bookmarks, updates some fields and the table of contents, saves
the document, and exits.
Now, I have to add a watermark. After spending way too much time coming up
with a solution, it turns out that the code only writes the watermark in the
first section. So I am looking for any help, advice, tips, code samples, or
anything else you can think of that will help me out (and take pity on me, as
I am a PowerBuilder developer by trade, acting as a VB/VBA developer as a
favor to my boss).
Thanks,
Glenn Harland
Here's the code:
wmtext = IIf(IsNull(watermark_text.Value), "", watermark_text.Value)
For ctr = 1 To oTemp.Sections.Count
For idx = 1 To 3
With
oTemp.Sections(ctr).Headers(idx).Shapes.AddTextEffect(powerpluswatermarkobject1, wmtext, "Times New Roman", 1, False, False, 0, 0)
.TextEffect.NormalizedHeight = False
.Line.Visible = False
.Fill.Visible = True
.Fill.Solid
.Fill.ForeColor.RGB = RGB(192, 192, 192)
.Fill.Transparency = 0.5
.Rotation = 315
.LockAspectRatio = True
.Height = oWord.InchesToPoints(2.27)
.Width = oWord.InchesToPoints(7.95)
.WrapFormat.AllowOverlap = True
.WrapFormat.Side = wdWrapNone
.WrapFormat.Type = 3
.RelativeHorizontalPosition = wdRelativeHorizontalPositionMargin
.RelativeVerticalPosition = wdRelativeVerticalPositionMargin
.Left = wdShapeCenter
.Top = wdShapeCenter
End With
Next
Next
because there is specific text in each header.
From an Access database, I have code that opens the Word document, replaces
a bunch of bookmarks, updates some fields and the table of contents, saves
the document, and exits.
Now, I have to add a watermark. After spending way too much time coming up
with a solution, it turns out that the code only writes the watermark in the
first section. So I am looking for any help, advice, tips, code samples, or
anything else you can think of that will help me out (and take pity on me, as
I am a PowerBuilder developer by trade, acting as a VB/VBA developer as a
favor to my boss).
Thanks,
Glenn Harland
Here's the code:
wmtext = IIf(IsNull(watermark_text.Value), "", watermark_text.Value)
For ctr = 1 To oTemp.Sections.Count
For idx = 1 To 3
With
oTemp.Sections(ctr).Headers(idx).Shapes.AddTextEffect(powerpluswatermarkobject1, wmtext, "Times New Roman", 1, False, False, 0, 0)
.TextEffect.NormalizedHeight = False
.Line.Visible = False
.Fill.Visible = True
.Fill.Solid
.Fill.ForeColor.RGB = RGB(192, 192, 192)
.Fill.Transparency = 0.5
.Rotation = 315
.LockAspectRatio = True
.Height = oWord.InchesToPoints(2.27)
.Width = oWord.InchesToPoints(7.95)
.WrapFormat.AllowOverlap = True
.WrapFormat.Side = wdWrapNone
.WrapFormat.Type = 3
.RelativeHorizontalPosition = wdRelativeHorizontalPositionMargin
.RelativeVerticalPosition = wdRelativeVerticalPositionMargin
.Left = wdShapeCenter
.Top = wdShapeCenter
End With
Next
Next