Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Laurie Laurie is offline
external usenet poster
 
Posts: 30
Default macros with a watermark

I have created a macros that creates a watermark and then prints. The macros
will work on the document i create it on but when i use the macro on another
document it does not insert the watermark on each page. Any suggestions is
appreciated.
--
Laurie
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default macros with a watermark

Post your code!

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Laurie wrote:
I have created a macros that creates a watermark and then prints.
The macros will work on the document i create it on but when i use
the macro on another document it does not insert the watermark on
each page. Any suggestions is appreciated.



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Laurie Laurie is offline
external usenet poster
 
Posts: 30
Default macros with a watermark

I have re-created it and have a different error. I have code posted below.

Sub UNCONROLLED()
'
' UNCONROLLED Macro
' To create an "UNCONTROLLED" watermark on all SOP documents.
'
ActiveDocument.Sections(1).Range.Select
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.Shapes.AddTextEffect( _
PowerPlusWaterMarkObject222032625, "UNCONTROLLED", "Times New
Roman", 1, _
False, False, 0, 0).Select
Selection.ShapeRange.Name = "PowerPlusWaterMarkObject222032625"
Selection.ShapeRange.TextEffect.NormalizedHeight = False
Selection.ShapeRange.Line.Visible = False
Selection.ShapeRange.Fill.Visible = True
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(192, 192, 192)
Selection.ShapeRange.Fill.Transparency = 0.5
Selection.ShapeRange.Rotation = 315
Selection.ShapeRange.LockAspectRatio = True
Selection.ShapeRange.Height = InchesToPoints(1.31)
Selection.ShapeRange.Width = InchesToPoints(7.85)
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


--
Laurie


"Graham Mayor" wrote:

Post your code!

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Laurie wrote:
I have created a macros that creates a watermark and then prints.
The macros will work on the document i create it on but when i use
the macro on another document it does not insert the watermark on
each page. Any suggestions is appreciated.




  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default macros with a watermark

Unfortunately you cannot always rely on the macro recorder.

Removing the line
Selection.ShapeRange.name = "PowerPlusWaterMarkObject222032625"
should fix it

or cleaned up a bit

Sub Uncontrolled()
Dim sWMarkText As String
sWMarkText = "UNCONTROLLED"
ActiveDocument.Sections(1).Range.Select
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.Shapes.AddTextEffect(msoTex tEffect1, _
sWMarkText, "Times New Roman", 1, False, False, 0, 0).Select
With Selection.ShapeRange
.name = "MyWaterMarkObj001"
.TextEffect.NormalizedHeight = False
.Line.Visible = False
.Fill.Visible = True
.Fill.Solid
.Fill.ForeColor = wdColorGray25
.Fill.Transparency = 0.5
.Rotation = 315
.LockAspectRatio = True
.Height = InchesToPoints(1.31)
.Width = InchesToPoints(7.85)
.WrapFormat.AllowOverlap = True
.WrapFormat.Side = wdWrapNone
.WrapFormat.Type = 3
.RelativeHorizontalPosition = wdRelativeVerticalPositionMargin
.RelativeVerticalPosition = wdRelativeVerticalPositionMargin
.Left = wdShapeCenter
.Top = wdShapeCenter
End With
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Laurie wrote:
I have re-created it and have a different error. I have code posted
below.

Sub UNCONROLLED()
'
' UNCONROLLED Macro
' To create an "UNCONTROLLED" watermark on all SOP documents.
'
ActiveDocument.Sections(1).Range.Select
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.Shapes.AddTextEffect( _
PowerPlusWaterMarkObject222032625, "UNCONTROLLED", "Times New
Roman", 1, _
False, False, 0, 0).Select
Selection.ShapeRange.Name = "PowerPlusWaterMarkObject222032625"
Selection.ShapeRange.TextEffect.NormalizedHeight = False
Selection.ShapeRange.Line.Visible = False
Selection.ShapeRange.Fill.Visible = True
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(192, 192, 192)
Selection.ShapeRange.Fill.Transparency = 0.5
Selection.ShapeRange.Rotation = 315
Selection.ShapeRange.LockAspectRatio = True
Selection.ShapeRange.Height = InchesToPoints(1.31)
Selection.ShapeRange.Width = InchesToPoints(7.85)
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



Post your code!

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Laurie wrote:
I have created a macros that creates a watermark and then prints.
The macros will work on the document i create it on but when i use
the macro on another document it does not insert the watermark on
each page. Any suggestions is appreciated.



  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Laurie Laurie is offline
external usenet poster
 
Posts: 30
Default macros with a watermark

Can you please look at the following code? Now when I use it on a new
document it will print the watermark on only 1 page when i have a document
with multiple pages. Thanks

Laurie

Sub UNCONTROLLED()
'
' UNCONTROLLED Macro
'
'
Selection.WholeStory
ActiveDocument.Sections(1).Range.Select
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.Shapes.AddTextEffect( _
PowerPlusWaterMarkObject14494265, "UNCONTROLLED", "Times New Roman",
1, _
False, False, 0, 0).Select
Selection.ShapeRange.Name = "PowerPlusWaterMarkObject14494265"
Selection.ShapeRange.TextEffect.NormalizedHeight = False
Selection.ShapeRange.Line.Visible = False
Selection.ShapeRange.Fill.Visible = True
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(192, 192, 192)
Selection.ShapeRange.Fill.Transparency = 0.5
Selection.ShapeRange.Rotation = 315
Selection.ShapeRange.LockAspectRatio = True
Selection.ShapeRange.Height = InchesToPoints(1.31)
Selection.ShapeRange.Width = InchesToPoints(7.85)
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
ActiveDocument.PrintOut
End Sub

--
Laurie


"Graham Mayor" wrote:

Unfortunately you cannot always rely on the macro recorder.

Removing the line
Selection.ShapeRange.name = "PowerPlusWaterMarkObject222032625"
should fix it

or cleaned up a bit

Sub Uncontrolled()
Dim sWMarkText As String
sWMarkText = "UNCONTROLLED"
ActiveDocument.Sections(1).Range.Select
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.Shapes.AddTextEffect(msoTex tEffect1, _
sWMarkText, "Times New Roman", 1, False, False, 0, 0).Select
With Selection.ShapeRange
.name = "MyWaterMarkObj001"
.TextEffect.NormalizedHeight = False
.Line.Visible = False
.Fill.Visible = True
.Fill.Solid
.Fill.ForeColor = wdColorGray25
.Fill.Transparency = 0.5
.Rotation = 315
.LockAspectRatio = True
.Height = InchesToPoints(1.31)
.Width = InchesToPoints(7.85)
.WrapFormat.AllowOverlap = True
.WrapFormat.Side = wdWrapNone
.WrapFormat.Type = 3
.RelativeHorizontalPosition = wdRelativeVerticalPositionMargin
.RelativeVerticalPosition = wdRelativeVerticalPositionMargin
.Left = wdShapeCenter
.Top = wdShapeCenter
End With
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Laurie wrote:
I have re-created it and have a different error. I have code posted
below.

Sub UNCONROLLED()
'
' UNCONROLLED Macro
' To create an "UNCONTROLLED" watermark on all SOP documents.
'
ActiveDocument.Sections(1).Range.Select
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.Shapes.AddTextEffect( _
PowerPlusWaterMarkObject222032625, "UNCONTROLLED", "Times New
Roman", 1, _
False, False, 0, 0).Select
Selection.ShapeRange.Name = "PowerPlusWaterMarkObject222032625"
Selection.ShapeRange.TextEffect.NormalizedHeight = False
Selection.ShapeRange.Line.Visible = False
Selection.ShapeRange.Fill.Visible = True
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(192, 192, 192)
Selection.ShapeRange.Fill.Transparency = 0.5
Selection.ShapeRange.Rotation = 315
Selection.ShapeRange.LockAspectRatio = True
Selection.ShapeRange.Height = InchesToPoints(1.31)
Selection.ShapeRange.Width = InchesToPoints(7.85)
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



Post your code!

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Laurie wrote:
I have created a macros that creates a watermark and then prints.
The macros will work on the document i create it on but when i use
the macro on another document it does not insert the watermark on
each page. Any suggestions is appreciated.






  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default macros with a watermark

The problems arise as there are three possible headers for each section, and
each header would need to be addressed separately with due regard for
whatever may already be in the header to which you wish to add a watermark.

If I was doing this for myself, I would save the watermark as an autotext
entry (building block in Word 2007) in the normal template (or the document
template) . This eliminates all that formatting on the fly. Then insert the
autotext (building block) entry at the end of each of the header ranges, for
each section, as follows.

If you save the autotext entry in the document template then Instead of
NormalTemplate use ActiveDocument.AttachedTemplate

Sub UncontrolledWord2007()
Dim i As Long
Dim oRange As Range
Dim oBB As BuildingBlock
Set oBB = NormalTemplate.BuildingBlockEntries("UNCONTROLLED" )
For i = 1 To ActiveDocument.Sections.Count
Set oRange =
ActiveDocument.Sections(i).Headers(wdHeaderFooterF irstPage).Range
oRange.Collapse wdCollapseEnd
oBB.Insert _
Whe=oRange, _
RichText:=True
Set oRange =
ActiveDocument.Sections(i).Headers(wdHeaderFooterP rimary).Range
oRange.Collapse wdCollapseEnd
oBB.Insert _
Whe=oRange, _
RichText:=True
Set oRange =
ActiveDocument.Sections(i).Headers(wdHeaderFooterE venPages).Range
oRange.Collapse wdCollapseEnd
oBB.Insert _
Whe=oRange, _
RichText:=True
Next i
End Sub

Sub UncontrolledWord2003()
Dim i As Long
Dim oRange As Range
For i = 1 To ActiveDocument.Sections.Count
Set oRange =
ActiveDocument.Sections(i).Headers(wdHeaderFooterF irstPage).Range
oRange.Collapse wdCollapseEnd
NormalTemplate.AutoTextEntries("UNCONTROLLED") _
.Insert Whe=oRange, _
RichText:=True
Set oRange =
ActiveDocument.Sections(i).Headers(wdHeaderFooterP rimary).Range
oRange.Collapse wdCollapseEnd
NormalTemplate.AutoTextEntries("UNCONTROLLED") _
.Insert Whe=oRange, _
RichText:=True
Set oRange =
ActiveDocument.Sections(i).Headers(wdHeaderFooterE venPages).Range
oRange.Collapse wdCollapseEnd
NormalTemplate.AutoTextEntries("UNCONTROLLED") _
.Insert Whe=oRange, _
RichText:=True
Next i
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




Laurie wrote:
Can you please look at the following code? Now when I use it on a new
document it will print the watermark on only 1 page when i have a
document with multiple pages. Thanks

Laurie

Sub UNCONTROLLED()
'
' UNCONTROLLED Macro
'
'
'Selection.WholeStory
ActiveDocument.Sections(1).Range.Select
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.Shapes.AddTextEffect( _
PowerPlusWaterMarkObject14494265, "UNCONTROLLED", "Times New
Roman", 1, _
False, False, 0, 0).Select
Selection.ShapeRange.Name = "PowerPlusWaterMarkObject14494265"
Selection.ShapeRange.TextEffect.NormalizedHeight = False
Selection.ShapeRange.Line.Visible = False
Selection.ShapeRange.Fill.Visible = True
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(192, 192, 192)
Selection.ShapeRange.Fill.Transparency = 0.5
Selection.ShapeRange.Rotation = 315
Selection.ShapeRange.LockAspectRatio = True
Selection.ShapeRange.Height = InchesToPoints(1.31)
Selection.ShapeRange.Width = InchesToPoints(7.85)
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
ActiveDocument.PrintOut
End Sub


Unfortunately you cannot always rely on the macro recorder.

Removing the line
Selection.ShapeRange.name = "PowerPlusWaterMarkObject222032625"
should fix it

or cleaned up a bit

Sub Uncontrolled()
Dim sWMarkText As String
sWMarkText = "UNCONTROLLED"
ActiveDocument.Sections(1).Range.Select
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.Shapes.AddTextEffect(msoTex tEffect1, _
sWMarkText, "Times New Roman", 1, False, False, 0, 0).Select
With Selection.ShapeRange
.name = "MyWaterMarkObj001"
.TextEffect.NormalizedHeight = False
.Line.Visible = False
.Fill.Visible = True
.Fill.Solid
.Fill.ForeColor = wdColorGray25
.Fill.Transparency = 0.5
.Rotation = 315
.LockAspectRatio = True
.Height = InchesToPoints(1.31)
.Width = InchesToPoints(7.85)
.WrapFormat.AllowOverlap = True
.WrapFormat.Side = wdWrapNone
.WrapFormat.Type = 3
.RelativeHorizontalPosition = wdRelativeVerticalPositionMargin
.RelativeVerticalPosition = wdRelativeVerticalPositionMargin
.Left = wdShapeCenter
.Top = wdShapeCenter
End With
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Laurie wrote:
I have re-created it and have a different error. I have code posted
below.

Sub UNCONROLLED()
'
' UNCONROLLED Macro
' To create an "UNCONTROLLED" watermark on all SOP documents.
'
ActiveDocument.Sections(1).Range.Select
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.Shapes.AddTextEffect( _
PowerPlusWaterMarkObject222032625, "UNCONTROLLED", "Times New
Roman", 1, _
False, False, 0, 0).Select
Selection.ShapeRange.Name = "PowerPlusWaterMarkObject222032625"
Selection.ShapeRange.TextEffect.NormalizedHeight = False
Selection.ShapeRange.Line.Visible = False
Selection.ShapeRange.Fill.Visible = True
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(192, 192, 192)
Selection.ShapeRange.Fill.Transparency = 0.5
Selection.ShapeRange.Rotation = 315
Selection.ShapeRange.LockAspectRatio = True
Selection.ShapeRange.Height = InchesToPoints(1.31)
Selection.ShapeRange.Width = InchesToPoints(7.85)
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



Post your code!

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Laurie wrote:
I have created a macros that creates a watermark and then prints.
The macros will work on the document i create it on but when i use
the macro on another document it does not insert the watermark on
each page. Any suggestions is appreciated.



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to remove watermark liked, but not watermark, text? Kam127 Microsoft Word Help 6 December 17th 09 11:59 AM
Word & Enable Macros and Disable macros Theresa Microsoft Word Help 1 September 29th 08 10:38 PM
Using both picture watermark and text watermark in same document jazzygal Microsoft Word Help 1 April 14th 08 11:16 PM
I need a WATERMARK ON CERTAIN PAGES and nO WATERMARK ON OTHERS. psushu Microsoft Word Help 2 March 8th 06 04:29 PM
How do you remove watermark in doc if no watermark is selected? Yin Microsoft Word Help 1 September 20th 05 10:28 PM


All times are GMT +1. The time now is 09:25 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"