I am using the macro recorder to figure out how to automatically insert
a gif as a watermark. It's easy to do manually but when the resulting
macro is run, it always deletes the table and contained text that I need
in the header? That does not happen when I create the macro. Here is the
macro:

ActiveDocument.Sections(1).Range.Select
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.Shapes.AddPicture(FileName:= _
"c:\letterhead\letterhead parts\watermark.gif" _
, LinkToFile:=False, SaveWithDocument:=True).Select
Selection.ShapeRange.Name = "WordPictureWatermark1"
Selection.ShapeRange.PictureFormat.Brightness = 0.5
Selection.ShapeRange.PictureFormat.Contrast = 0.5
Selection.ShapeRange.LockAspectRatio = True
Selection.ShapeRange.Height = InchesToPoints(10.47)
Selection.ShapeRange.Width = InchesToPoints(8.14)
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

RE: Running 'watermark' macro deletes all header text by gordon(dot)bentleymix(at)gmail(dot)com>

gordon(dot)bentleymix(at)gmail(dot)com>
Mon Jun 16 19:45:01 PDT 2008

I am unable to recreate the behaviour you have described. However, if it does
occur - and I have no doubt that it does - the problem may be with the use of
the Selection object. Try working with the Range object instead. Something
like this:

Sub InsertWaterMark()
Dim myRange As Range
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Shapes _
.AddPicture "c:\letterhead\letterhead parts\watermark.gif"
Set myRange =
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.ShapeRange
With myRange
.Name = "WordPictureWatermark1"
.PictureFormat.Brightness = 0.5
.PictureFormat.Contrast = 0.5
.LockAspectRatio = True
.Height = InchesToPoints(10.47)
.Width = InchesToPoints(8.14)
.WrapFormat.AllowOverlap = True
.WrapFormat.Side = wdWrapNone
.WrapFormat.Type = 3
.RelativeHorizontalPosition = wdRelativeVerticalPositionMargin
.RelativeVerticalPosition = wdRelativeVerticalPositionMargin
.Left = wdShapeCenter
.Top = wdShapeCenter
End With
End Sub
--
Cheers!
Gordon

Uninvited email contact will be marked as SPAM and ignored. Please post all
follow-ups to the newsgroup.


"ableone" wrote:

> I am using the macro recorder to figure out how to automatically insert
> a gif as a watermark. It's easy to do manually but when the resulting
> macro is run, it always deletes the table and contained text that I need
> in the header? That does not happen when I create the macro. Here is the
> macro:
>
> ActiveDocument.Sections(1).Range.Select
> ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
> Selection.HeaderFooter.Shapes.AddPicture(FileName:= _
> "c:\letterhead\letterhead parts\watermark.gif" _
> , LinkToFile:=False, SaveWithDocument:=True).Select
> Selection.ShapeRange.Name = "WordPictureWatermark1"
> Selection.ShapeRange.PictureFormat.Brightness = 0.5
> Selection.ShapeRange.PictureFormat.Contrast = 0.5
> Selection.ShapeRange.LockAspectRatio = True
> Selection.ShapeRange.Height = InchesToPoints(10.47)
> Selection.ShapeRange.Width = InchesToPoints(8.14)
> 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
>

Re: Running 'watermark' macro deletes all header text by Doug

Doug
Mon Jun 16 19:52:29 PDT 2008

Try

Dim myrange as Range, srange as ShapeRange
Set myrange = Selection.Sections(1).Headers(wdHeaderFooterPrimary).Range
myrange.Collapse wdCollapseEnd
Set srange = ActiveDocument.InLineShapes.AddPicture(Filename: =
"c:\letterhead\letterhead parts\watermark.gif" _
, LinkToFile:=False, SaveWithDocument:=True, Range: = myrange)
With srange
.Name = "WordPictureWatermark1"
.PictureFormat.Brightness = 0.5
.PictureFormat.Contrast = 0.5
.LockAspectRatio = True
.Height = InchesToPoints(10.47)
.Width = InchesToPoints(8.14)
.WrapFormat.AllowOverlap = True
.WrapFormat.Side = wdWrapNone
.WrapFormat.Type = 3
.RelativeHorizontalPosition = wdRelativeVerticalPositionMargin
.RelativeVerticalPosition = wdRelativeVerticalPositionMargin
.Left = wdShapeCenter
.Top = wdShapeCenter
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"ableone" <able@able.one> wrote in message
news:MPG.22c0b988d34ec1c9896d0@msnews.microsoft.com...
>I am using the macro recorder to figure out how to automatically insert
> a gif as a watermark. It's easy to do manually but when the resulting
> macro is run, it always deletes the table and contained text that I need
> in the header? That does not happen when I create the macro. Here is the
> macro:
>
> ActiveDocument.Sections(1).Range.Select
> ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
> Selection.HeaderFooter.Shapes.AddPicture(FileName:= _
> "c:\letterhead\letterhead parts\watermark.gif" _
> , LinkToFile:=False, SaveWithDocument:=True).Select
> Selection.ShapeRange.Name = "WordPictureWatermark1"
> Selection.ShapeRange.PictureFormat.Brightness = 0.5
> Selection.ShapeRange.PictureFormat.Contrast = 0.5
> Selection.ShapeRange.LockAspectRatio = True
> Selection.ShapeRange.Height = InchesToPoints(10.47)
> Selection.ShapeRange.Width = InchesToPoints(8.14)
> 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



Re: Running 'watermark' macro deletes all header text by ableone

ableone
Mon Jun 16 23:17:46 PDT 2008

In article <u$ppyUC0IHA.2064@TK2MSFTNGP05.phx.gbl>,
dkr@REMOVECAPSmvps.org says...
> Try
>
> Dim myrange as Range, srange as ShapeRange
> Set myrange = Selection.Sections(1).Headers(wdHeaderFooterPrimary).Range
> myrange.Collapse wdCollapseEnd
> Set srange = ActiveDocument.InLineShapes.AddPicture(Filename: =
> "c:\letterhead\letterhead parts\watermark.gif" _
> , LinkToFile:=False, SaveWithDocument:=True, Range: = myrange)
> With srange
> .Name = "WordPictureWatermark1"
> .PictureFormat.Brightness = 0.5
> .PictureFormat.Contrast = 0.5
> .LockAspectRatio = True
> .Height = InchesToPoints(10.47)
> .Width = InchesToPoints(8.14)
> .WrapFormat.AllowOverlap = True
> .WrapFormat.Side = wdWrapNone
> .WrapFormat.Type = 3
> .RelativeHorizontalPosition = wdRelativeVerticalPositionMargin
> .RelativeVerticalPosition = wdRelativeVerticalPositionMargin
> .Left = wdShapeCenter
> .Top = wdShapeCenter
> End With
>
For some reason I get Type mismatch error on the Set srange =
ActiveDocument.InLineShapes etc line?

RE: Running 'watermark' macro deletes all header text by ableone

ableone
Mon Jun 16 23:22:37 PDT 2008

I get "method or data member not found" at the line

.Name = "WordPictureWatermark1"

In article <163AAACF-A59C-484C-80AC-85FE17E69368@microsoft.com>, =?Utf-
8?B?R29yZG9uIEJlbnRsZXktTWl4?= <gordon(dot)bentleymix(at)gmail(dot)com>
says...
> I am unable to recreate the behaviour you have described. However, if it does
> occur - and I have no doubt that it does - the problem may be with the use of
> the Selection object. Try working with the Range object instead. Something
> like this:
>
> Sub InsertWaterMark()
> Dim myRange As Range
> ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Shapes _
> .AddPicture "c:\letterhead\letterhead parts\watermark.gif"
> Set myRange =
> ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.ShapeRange
> With myRange
> .Name = "WordPictureWatermark1"
> .PictureFormat.Brightness = 0.5
> .PictureFormat.Contrast = 0.5
> .LockAspectRatio = True
> .Height = InchesToPoints(10.47)
> .Width = InchesToPoints(8.14)
> .WrapFormat.AllowOverlap = True
> .WrapFormat.Side = wdWrapNone
> .WrapFormat.Type = 3
> .RelativeHorizontalPosition = wdRelativeVerticalPositionMargin
> .RelativeVerticalPosition = wdRelativeVerticalPositionMargin
> .Left = wdShapeCenter
> .Top = wdShapeCenter
> End With
> End Sub
>

RE: Running 'watermark' macro deletes all header text by JeanGuyMarcil

JeanGuyMarcil
Tue Jun 17 05:14:01 PDT 2008

"ableone" wrote:

> I am using the macro recorder to figure out how to automatically insert
> a gif as a watermark. It's easy to do manually but when the resulting
> macro is run, it always deletes the table and contained text that I need
> in the header? That does not happen when I create the macro. Here is the
> macro:
>
> ActiveDocument.Sections(1).Range.Select
> ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
> Selection.HeaderFooter.Shapes.AddPicture(FileName:= _
> "c:\letterhead\letterhead parts\watermark.gif" _
> , LinkToFile:=False, SaveWithDocument:=True).Select
> Selection.ShapeRange.Name = "WordPictureWatermark1"
> Selection.ShapeRange.PictureFormat.Brightness = 0.5
> Selection.ShapeRange.PictureFormat.Contrast = 0.5
> Selection.ShapeRange.LockAspectRatio = True
> Selection.ShapeRange.Height = InchesToPoints(10.47)
> Selection.ShapeRange.Width = InchesToPoints(8.14)
> 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

If you are going to insert an InLineShape, use this:

Dim myrange As Range
Dim srange As InlineShape

Set myrange = Selection.Sections(1).Headers(wdHeaderFooterPrimary).Range
myrange.Collapse wdCollapseEnd

Set srange =
myrange.InlineShapes.AddPicture(FileName:="c:\letterhead\letterhead
parts\watermark.gif" _
, LinkToFile:=False, SaveWithDocument:=True, Range:=myrange)

With srange
.PictureFormat.Brightness = 0.5
.PictureFormat.Contrast = 0.5
.LockAspectRatio = True
.Height = InchesToPoints(10.47)
.Width = InchesToPoints(8.14)
End With

You cannot name an InLineShape and wrapping does not apply. But, for a
watermark, an InLineShape is not a good idea!

For a floating picture, use:

Dim srange As Shape

Set srange = ActiveDocument.Sections(1) _
.Headers(wdHeaderFooterPrimary).Shapes _
.AddPicture(FileName:="c:\letterhead\letterhead parts\watermark.gif")

With srange
.Name = "WordPictureWatermark1"
.PictureFormat.Brightness = 0.5
.PictureFormat.Contrast = 0.5
.LockAspectRatio = True
.Height = InchesToPoints(10.47)
.Width = InchesToPoints(8.14)
.WrapFormat.AllowOverlap = True
.WrapFormat.Side = wdWrapNone
.WrapFormat.Type = 3
.RelativeHorizontalPosition = wdRelativeVerticalPositionMargin
.RelativeVerticalPosition = wdRelativeVerticalPositionMargin
.Left = wdShapeCenter
.Top = wdShapeCenter
End With

RE: Running 'watermark' macro deletes all header text by ableone

ableone
Tue Jun 17 08:11:24 PDT 2008

Yes that works, thank you!

RE: Running 'watermark' macro deletes all header text by ableone

ableone
Tue Jun 17 08:27:04 PDT 2008

In article <MPG.22c173f56dedf7859896d3@msnews.microsoft.com>,
able@able.one says...
> Yes that works, thank you!
>
Woops, no it didn't...it runs, unlike the other two suggestions, but the
header table and assoc text still get overwritten.

RE: Running 'watermark' macro deletes all header text by JeanGuyMarcil

JeanGuyMarcil
Tue Jun 17 09:16:03 PDT 2008

"ableone" wrote:

> In article <MPG.22c173f56dedf7859896d3@msnews.microsoft.com>,
> able@able.one says...
> > Yes that works, thank you!
> >
> Woops, no it didn't...it runs, unlike the other two suggestions, but the
> header table and assoc text still get overwritten.
>

The code I posted does not overwrite the header content.
However, I see that you use quite a large setting for the picture size
(.Height = InchesToPoints(10.47)). Since the picture is set to float over the
text, it is possible that a picture that is so large will cover up the header
content.

Make the piscture smaller...: ".Height = InchesToPoints(8)"

RE: Running 'watermark' macro deletes all header text by ableone

ableone
Tue Jun 17 09:51:14 PDT 2008

In article <FAFAFE83-DA88-444C-AF38-18E8B61A57F4@microsoft.com>,
JeanGuyMarcil@discussions.microsoft.com says...
> "ableone" wrote:
>
> > In article <MPG.22c173f56dedf7859896d3@msnews.microsoft.com>,
> > able@able.one says...
> > > Yes that works, thank you!
> > >
> > Woops, no it didn't...it runs, unlike the other two suggestions, but the
> > header table and assoc text still get overwritten.
> >
>
> The code I posted does not overwrite the header content.
> However, I see that you use quite a large setting for the picture size
> (.Height = InchesToPoints(10.47)). Since the picture is set to float over the
> text, it is possible that a picture that is so large will cover up the header
> content.
>
> Make the piscture smaller...: ".Height = InchesToPoints(8)"
>
OK, thanks again. This 'picture' is a full size image that needs to act
as a watermark behind all other text etc. I will look for the right
setting to make it float behind all other objects, but since I'm so weak
with Word, any clues appreciated!

RE: Running 'watermark' macro deletes all header text by JeanGuyMarcil

JeanGuyMarcil
Tue Jun 17 10:47:03 PDT 2008

"ableone" wrote:

> In article <FAFAFE83-DA88-444C-AF38-18E8B61A57F4@microsoft.com>,
> JeanGuyMarcil@discussions.microsoft.com says...
> > "ableone" wrote:
> >
> > > In article <MPG.22c173f56dedf7859896d3@msnews.microsoft.com>,
> > > able@able.one says...
> > > > Yes that works, thank you!
> > > >
> > > Woops, no it didn't...it runs, unlike the other two suggestions, but the
> > > header table and assoc text still get overwritten.
> > >
> >
> > The code I posted does not overwrite the header content.
> > However, I see that you use quite a large setting for the picture size
> > (.Height = InchesToPoints(10.47)). Since the picture is set to float over the
> > text, it is possible that a picture that is so large will cover up the header
> > content.
> >
> > Make the piscture smaller...: ".Height = InchesToPoints(8)"
> >
> OK, thanks again. This 'picture' is a full size image that needs to act
> as a watermark behind all other text etc. I will look for the right
> setting to make it float behind all other objects, but since I'm so weak
> with Word, any clues appreciated!

Sorry, I should have given you the necessary code right away...

Finish the With block like this:

.Top = wdShapeCenter
.ZOrder msoSendBehindText
End With

The .ZOrder property will send the image behind the text.


RE: Running 'watermark' macro deletes all header text by ableone

ableone
Tue Jun 17 10:54:24 PDT 2008

Perfect!

RE: Running 'watermark' macro deletes all header text by ableone

ableone
Thu Jun 19 07:10:44 PDT 2008

In article <7127A2B2-D8EC-4AAE-9DEE-1A373DAE96F2@microsoft.com>,
JeanGuyMarcil@discussions.microsoft.com says...
> "ableone" wrote:
>
> > In article <FAFAFE83-DA88-444C-AF38-18E8B61A57F4@microsoft.com>,
> > JeanGuyMarcil@discussions.microsoft.com says...
> > > "ableone" wrote:
> > >
> > > > In article <MPG.22c173f56dedf7859896d3@msnews.microsoft.com>,
> > > > able@able.one says...
> > > > > Yes that works, thank you!
> > > > >
> > > > Woops, no it didn't...it runs, unlike the other two suggestions, but the
> > > > header table and assoc text still get overwritten.
> > > >
> > >
> > > The code I posted does not overwrite the header content.
> > > However, I see that you use quite a large setting for the picture size
> > > (.Height = InchesToPoints(10.47)). Since the picture is set to float over the
> > > text, it is possible that a picture that is so large will cover up the header
> > > content.
> > >
> > > Make the piscture smaller...: ".Height = InchesToPoints(8)"
> > >
> > OK, thanks again. This 'picture' is a full size image that needs to act
> > as a watermark behind all other text etc. I will look for the right
> > setting to make it float behind all other objects, but since I'm so weak
> > with Word, any clues appreciated!
>
> Sorry, I should have given you the necessary code right away...
>
> Finish the With block like this:
>
> .Top = wdShapeCenter
> .ZOrder msoSendBehindText
> End With
>
> The .ZOrder property will send the image behind the text.
>
>
It turns out there is another issue. That is, while it renders fine in
word 2003, it does not in word 2000. It's going to be deployed on a site
using word 2000. The issue is that the header table and it's text are
still rendered behind the full size image. Word 2003 seems to handle the
image in header differently; I can't seem to select it in quite the same
way etc. Any clues?

RE: Running 'watermark' macro deletes all header text by ableone

ableone
Thu Jun 19 07:18:37 PDT 2008

What I mean about selecting the image in word 2000 is complicated.

If I open the doc without header/footer showing in view, the image is
not selectable or movable immediately, but the cursor shows the image
icon in areas where there is no regular text. A right click in those
areas give me the option to view the images toolbar. But the images
toolbar has all of it's options greyed out. I can't del the image.

If I shows header/footer, I'm no longer able to select the image and the
cursor is 'normal' and no right click menu option for images.

All I need to be able to do it to have the zorder setting work, because
in word 2000 I'm back to the issue where the header table with it's text
is behind the image.

RE: Running 'watermark' macro deletes all header text by JeanGuyMarcil

JeanGuyMarcil
Thu Jun 19 07:32:02 PDT 2008

"ableone" wrote:

> What I mean about selecting the image in word 2000 is complicated.
>
> If I open the doc without header/footer showing in view, the image is

What do you mean by that? How do you do that?

> not selectable or movable immediately, but the cursor shows the image
> icon in areas where there is no regular text. A right click in those
> areas give me the option to view the images toolbar. But the images
> toolbar has all of it's options greyed out. I can't del the image.
>
> If I shows header/footer, I'm no longer able to select the image and the
> cursor is 'normal' and no right click menu option for images.
>
> All I need to be able to do it to have the zorder setting work, because
> in word 2000 I'm back to the issue where the header table with it's text
> is behind the image.

I don't have Word 2000 available right now, so I can't test any of this.
But, it seems to me that all you have to do is make sure the Header/footer
is showing...

RE: Running 'watermark' macro deletes all header text by ableone

ableone
Thu Jun 19 07:41:18 PDT 2008

In article <C8A1794A-B350-43BC-ABE8-63DAF6AD4C70@microsoft.com>,
JeanGuyMarcil@discussions.microsoft.com says...
> "ableone" wrote:
>
> > What I mean about selecting the image in word 2000 is complicated.
> >
> > If I open the doc without header/footer showing in view, the image is
>
> What do you mean by that? How do you do that?
>
> > not selectable or movable immediately, but the cursor shows the image
> > icon in areas where there is no regular text. A right click in those
> > areas give me the option to view the images toolbar. But the images
> > toolbar has all of it's options greyed out. I can't del the image.
> >
> > If I shows header/footer, I'm no longer able to select the image and the
> > cursor is 'normal' and no right click menu option for images.
> >
> > All I need to be able to do it to have the zorder setting work, because
> > in word 2000 I'm back to the issue where the header table with it's text
> > is behind the image.
>
> I don't have Word 2000 available right now, so I can't test any of this.
> But, it seems to me that all you have to do is make sure the Header/footer
> is showing...
>
I mean the menu option view, header and footer has to be on before I
have access to header/footer. If I chose 'yes' for that, I do get into
the header, it's outline is there, but the image is not selectable etc.

Maybe I simply need to convert

.Top = wdShapeCenter
.ZOrder msoSendBehindText

to integer values, something like that?

RE: Running 'watermark' macro deletes all header text by ableone

ableone
Thu Jun 19 07:50:56 PDT 2008

> Maybe I simply need to convert
>
> .Top = wdShapeCenter
> .ZOrder msoSendBehindText
>
> to integer values, something like that?
>
That does not seem to help.

When I said the cursor changes (not in view / header and footer) I meant
the cursor has the four direction effect, as if I could move an object.
However the picture does not move if I try.

I noticed that when I insert that image manually all seems ok, it's in
the header for sure, it's selectable, cursor does not change to four
direction cursor, it's behind text etc.

RE: Running 'watermark' macro deletes all header text by ableone

ableone
Thu Jun 19 07:58:03 PDT 2008

One more clue...normally when viewing the doc the image in the header
area is greyed out; it loses the greyed out effect when I enter the
header area. With the end result of the word 2000 process, it's the
opposite; the image is greyed out when I enter the header and at full
color depth when viewing the doc normally (outside header area). That'd
seem to indicate that the image is not in the header...but then why
would it hide table in the header, and why isn't it selectable like a
normal image?

RE: Running 'watermark' macro deletes all header text by JeanGuyMarcil

JeanGuyMarcil
Thu Jun 19 08:12:02 PDT 2008

"ableone" wrote:

> > Maybe I simply need to convert
> >
> > .Top = wdShapeCenter
> > .ZOrder msoSendBehindText
> >
> > to integer values, something like that?
> >
> That does not seem to help.
>
> When I said the cursor changes (not in view / header and footer) I meant
> the cursor has the four direction effect, as if I could move an object.
> However the picture does not move if I try.
>
> I noticed that when I insert that image manually all seems ok, it's in
> the header for sure, it's selectable, cursor does not change to four
> direction cursor, it's behind text etc.

I am sorry, I do not understand what you re trying to do. You have code that
inserts an image in the header, but now you are trying to play with that
image after the code has inserted it... Why?

Also, I do not unsderstand the problem you have... If the image is in the
header, you cannot get contextual menu about images when the cursor is above
the image in the main body text area when the header is closed... But you
wrote that this is what is happening, at least, this is what I understand
from your description...

Just to be on the safe side, post the excat code you are now using.
I can test it in Word 2003, but, as I wrote earlier, not in 2000. However,
maybe someone has access to 2000 and will be able to test it.


RE: Running 'watermark' macro deletes all header text by ableone

ableone
Thu Jun 19 08:25:04 PDT 2008

When code is run in word 2003, the image is selectable in the header and
one can use the toolbar etc to set it's zorder. Since it's so broken in
word 2000, I'm trying to explore what the image settings are. I'm
reporting that I can't select the image, and that it seems to behave
oddly in that in some regards it seems to be in the header and in some
ways not. I'm reporting all that stuff so that someone can help me
figure out what's wrong with this in word 2000.

The code below is perfect in Word 2003.

Set srange = ActiveDocument.Sections(1) _
.Headers(wdHeaderFooterPrimary).Shapes _
.AddPicture(FileName:=strBasePath & strFileName)

With srange
.Name = "WordPictureWatermark1"
.PictureFormat.Brightness = 0.5
.PictureFormat.Contrast = 0.5
.LockAspectRatio = True
.Height = InchesToPoints(10.47)
.Width = InchesToPoints(8.14)
.WrapFormat.AllowOverlap = True
.WrapFormat.Side = wdWrapNone
.WrapFormat.Type = 3
.RelativeHorizontalPosition =
wdRelativeVerticalPositionMargin
.RelativeVerticalPosition =
wdRelativeVerticalPositionMargin
.Left = wdShapeCenter
.Top = wdShapeCenter
.IncrementLeft -43.2
.ZOrder msoSendBehindText
End With

ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument


RE: Running 'watermark' macro deletes all header text by ableone

ableone
Thu Jun 19 08:34:29 PDT 2008

> Also, I do not unsderstand the problem you have... If the image is in the
> header, you cannot get contextual menu about images when the cursor is above
> the image in the main body text area when the header is closed... But you
> wrote that this is what is happening, at least, this is what I understand
> from your description...

I've written how it behaves. I know it does not make any sense. When
that code runs in word 2000, the image does hide the header table and
text, but is not selectable to set zorder when header is open, and is
greyed out when header is open, and it not greyed out when header is
closed...but is still not selectable. It's not selectable as far as I
can tell in any view.

RE: Running 'watermark' macro deletes all header text by ableone

ableone
Thu Jun 19 08:46:46 PDT 2008

Another interesting bit on this...it does not matter which version of
word generates the page; both render incorrectly in word 2000. I guess
that means that it's not the code that is defective per se, but rather
that the way word 2000 interprets the doc when viewing.

RE: Running 'watermark' macro deletes all header text by JeanGuyMarcil

JeanGuyMarcil
Thu Jun 19 09:02:00 PDT 2008

"ableone" wrote:

> Another interesting bit on this...it does not matter which version of
> word generates the page; both render incorrectly in word 2000. I guess
> that means that it's not the code that is defective per se, but rather
> that the way word 2000 interprets the doc when viewing.

OK, I think I get it now! Finally....

Unfortunately, as I wrote a few times already, I do not have access to Word
2000.
What image format are you using?
From memory, I do not see anything in the code that isn't appropriate for
Word 2000.

Let's hope someone who has access to Word 2000 will jump in soon.

If, by tomorrow nobody else has jumped in, I would suggest you start a new
thread. You can copy/paste the code you are now using and all the relevant
infomation from the "few" (:-p) messages you have written. Hoepfully this
will get more attention...


RE: Running 'watermark' macro deletes all header text by ableone

ableone
Thu Jun 19 09:15:29 PDT 2008

In article <B097B6B8-85D9-4240-9780-26E8E575EF11@microsoft.com>,
JeanGuyMarcil@discussions.microsoft.com says...
> "ableone" wrote:
>
> > Another interesting bit on this...it does not matter which version of
> > word generates the page; both render incorrectly in word 2000. I guess
> > that means that it's not the code that is defective per se, but rather
> > that the way word 2000 interprets the doc when viewing.
>
> OK, I think I get it now! Finally....
>
> Unfortunately, as I wrote a few times already, I do not have access to Word
> 2000.
> What image format are you using?
> From memory, I do not see anything in the code that isn't appropriate for
> Word 2000.
>
> Let's hope someone who has access to Word 2000 will jump in soon.
>
> If, by tomorrow nobody else has jumped in, I would suggest you start a new
> thread. You can copy/paste the code you are now using and all the relevant
> infomation from the "few" (:-p) messages you have written. Hoepfully this
> will get more attention...
>
>
This is a gif.

Your advice has been so helpful, I really appreciate it. I'll repost
this iss tomorrow if I don't get more input on this thread today.