Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Custom watermark changes position on some machines
Hello
Using Office 2002 SP-2, Windows 2000 V5.0 SP-4. Several of my users are experiencing a problem with a custom watermark in Word. I created a macro to automatically add a watermark to a Word document and it works perfectly on most machines. The watermark is positioned centered both horizontally and vertically on the page. On some machines, when used with a particular template which has 2 sections, the watermark appears centered in the second section but shifted to the right in the first section. On the vast majority of machines this does not occur and the watermark is correctly positioned. I used the following code to create the watermark:- Sub Watermark() ' Sometimes (randomly, apparently) setting the RelativeHorizontalPosition ' property of the shape fails, so an 'On Error Resume Next' statement is used. On Error Resume Next Dim tText As String tText = InputBox("Note: it may take several seconds for the page numbers " _ & "to update correctly after inserting the watermark." & Chr(13) & Chr(13) _ & "Please enter text for watermark:", "Watermark") If tText "" Then Application.ScreenUpdating = False ' The code in this With statement just moves the cursor into ' the header (generated by the macro recorder) With ActiveWindow If .View.SplitSpecial wdPaneNone Then .Panes(2).Close End If With .ActivePane.View If .Type = wdNormalView Or .Type = wdOutlineView Then .Type = wdPrintView End If .SeekView = wdSeekCurrentPageHeader End With End With ' Place the shape then move it to the end of the header With Selection .HeaderFooter.Shapes.AddTextEffect(msoTextEffect2, tText, _ "Arial Black", 72#, msoFalse, msoFalse, 163.25, 60.25).Select .Cut .EndKey Unit:=wdStory .Paste End With ' Format the shape With Selection.ShapeRange .Fill.Visible = msoTrue .Fill.Solid .Fill.ForeColor.RGB = RGB(192, 192, 192) .Fill.Transparency = 0# .Line.Visible = msoFalse .LockAspectRatio = msoTrue .Height = 329.05 .Width = 302.4 .Rotation = 0# .RelativeHorizontalPosition = _ wdRelativeHorizontalPositionPage .RelativeVerticalPosition = _ wdRelativeVerticalPositionPage .Left = wdShapeCenter .Top = wdShapeCenter .LockAnchor = True .WrapFormat.Type = wdWrapNone End With ' Clean up ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument ActiveDocument.Fields.Update Application.ScreenUpdating = True End If End Sub I confess to having just recorded a macro and then added it to Normal.dot, but this has worked fine for most machines and I didn't really think there was that much to it. It may just be one of those things with Word that you just have to smile and shake your head at but I'd appreciate any thoughts on the subject. Thanks very much Denise Crawley |
#2
|
|||
|
|||
Sounds like something is pushing the Watermark across - could it be a
(possibly empty) page number frame as described in http://www.word.mvps.org/faqs/format...lyIndented.htm ? If you set your view options to show everything you can (anchors, text boundaries, all non-printing chars etc.) you may be able to determine what's there. Try using the drawing bar Select cursor to catch anything behind text. -- Margaret Aldis - Microsoft Word MVP Syntagma partnership site: http://www.syntagma.co.uk Word MVP FAQ site: http://www.word.mvps.org "Denise" wrote in message .. . Hello Using Office 2002 SP-2, Windows 2000 V5.0 SP-4. Several of my users are experiencing a problem with a custom watermark in Word. I created a macro to automatically add a watermark to a Word document and it works perfectly on most machines. The watermark is positioned centered both horizontally and vertically on the page. On some machines, when used with a particular template which has 2 sections, the watermark appears centered in the second section but shifted to the right in the first section. On the vast majority of machines this does not occur and the watermark is correctly positioned. I used the following code to create the watermark:- Sub Watermark() ' Sometimes (randomly, apparently) setting the RelativeHorizontalPosition ' property of the shape fails, so an 'On Error Resume Next' statement is used. On Error Resume Next Dim tText As String tText = InputBox("Note: it may take several seconds for the page numbers " _ & "to update correctly after inserting the watermark." & Chr(13) & Chr(13) _ & "Please enter text for watermark:", "Watermark") If tText "" Then Application.ScreenUpdating = False ' The code in this With statement just moves the cursor into ' the header (generated by the macro recorder) With ActiveWindow If .View.SplitSpecial wdPaneNone Then .Panes(2).Close End If With .ActivePane.View If .Type = wdNormalView Or .Type = wdOutlineView Then .Type = wdPrintView End If .SeekView = wdSeekCurrentPageHeader End With End With ' Place the shape then move it to the end of the header With Selection .HeaderFooter.Shapes.AddTextEffect(msoTextEffect2, tText, _ "Arial Black", 72#, msoFalse, msoFalse, 163.25, 60.25).Select .Cut .EndKey Unit:=wdStory .Paste End With ' Format the shape With Selection.ShapeRange .Fill.Visible = msoTrue .Fill.Solid .Fill.ForeColor.RGB = RGB(192, 192, 192) .Fill.Transparency = 0# .Line.Visible = msoFalse .LockAspectRatio = msoTrue .Height = 329.05 .Width = 302.4 .Rotation = 0# .RelativeHorizontalPosition = _ wdRelativeHorizontalPositionPage .RelativeVerticalPosition = _ wdRelativeVerticalPositionPage .Left = wdShapeCenter .Top = wdShapeCenter .LockAnchor = True .WrapFormat.Type = wdWrapNone End With ' Clean up ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument ActiveDocument.Fields.Update Application.ScreenUpdating = True End If End Sub I confess to having just recorded a macro and then added it to Normal.dot, but this has worked fine for most machines and I didn't really think there was that much to it. It may just be one of those things with Word that you just have to smile and shake your head at but I'd appreciate any thoughts on the subject. Thanks very much Denise Crawley |
#3
|
|||
|
|||
On Tue, 24 May 2005 13:50:12 +0100, Margaret Aldis wrote:
Sounds like something is pushing the Watermark across - could it be a (possibly empty) page number frame as described in http://www.word.mvps.org/faqs/format...lyIndented.htm ? If you set your view options to show everything you can (anchors, text boundaries, all non-printing chars etc.) you may be able to determine what's there. Try using the drawing bar Select cursor to catch anything behind text. Thanks for your prompt reply, Margaret. I've done as you suggested and analysed all the hidden elements of the document, comparing them to a similar one created on my own machine. There were no obvious differences in the hidden elements but one thing I did notice was that the formatting properties of the WordArt were different (they shouldn't be). However, when I set the properties to match those of the document created on my machine the watermark jumped too far over to the left and too high up the page! I think you're right that there is something influencing the placement of the watermark. The trouble is I can't find anything. It seems very strange that following the same procedure on 2 different machines should produce such different results. If anyone has come across similar I'd appreciate your thoughts too. Denise |
#4
|
|||
|
|||
Hi Denise,
Do the two documents come out the same in File=Web Page Preview? If there are no add-ins/templates that differ, and the printer drivers are the same, you may want to also check the settings in Tools=Options=Compatability and also the 'disable features' setting in Tools=Options=Save. The HTML source will sometimes show some formatting/style differences that don't appear in the user interface. ====== "Denise" wrote in message news On Tue, 24 May 2005 13:50:12 +0100, Margaret Aldis wrote: Thanks for your prompt reply, Margaret. I've done as you suggested and analysed all the hidden elements of the document, comparing them to a similar one created on my own machine. There were no obvious differences in the hidden elements but one thing I did notice was that the formatting properties of the WordArt were different (they shouldn't be). However, when I set the properties to match those of the document created on my machine the watermark jumped too far over to the left and too high up the page! I think you're right that there is something influencing the placement of the watermark. The trouble is I can't find anything. It seems very strange that following the same procedure on 2 different machines should produce such different results. If anyone has come across similar I'd appreciate your thoughts too. Denise -- Let us know if this helped you, Bob Buckland ?:-) MS Office System Products MVP *Courtesy is not expensive and can pay big dividends* For Everyday MS Office tips to "use right away" - http://microsoft.com/events/series/a...andtricks.mspx |
#5
|
|||
|
|||
On Tue, 24 May 2005 08:27:55 -0700, Bob Buckland ?:-) wrote:
Many thanks for your advice, Bob. I have had to leave this alone for the past couple of days as I've been caught up with other things but I will hopefully get to try out your suggestions in the next few days. Thanks again Denise Hi Denise, Do the two documents come out the same in File=Web Page Preview? If there are no add-ins/templates that differ, and the printer drivers are the same, you may want to also check the settings in Tools=Options=Compatability and also the 'disable features' setting in Tools=Options=Save. The HTML source will sometimes show some formatting/style differences that don't appear in the user interface. ====== "Denise" wrote in message news On Tue, 24 May 2005 13:50:12 +0100, Margaret Aldis wrote: Thanks for your prompt reply, Margaret. I've done as you suggested and analysed all the hidden elements of the document, comparing them to a similar one created on my own machine. There were no obvious differences in the hidden elements but one thing I did notice was that the formatting properties of the WordArt were different (they shouldn't be). However, when I set the properties to match those of the document created on my machine the watermark jumped too far over to the left and too high up the page! I think you're right that there is something influencing the placement of the watermark. The trouble is I can't find anything. It seems very strange that following the same procedure on 2 different machines should produce such different results. If anyone has come across similar I'd appreciate your thoughts too. Denise |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
expanding custom dictionary | Microsoft Word Help | |||
Watermark Problem | Microsoft Word Help | |||
How can I create a custom watermark or background for use in word. | Page Layout | |||
how can i change the position of a watermark | Microsoft Word Help | |||
Setting custom size problem | Page Layout |