I created a form for an existing paper form - a simple half page, one section
template. The idea is to fill in the fields with a picture of the original
paper form as a watermark (as a guide). Before printing onto the paper form,
the watermark must be removed. Ideally, one macro that runs on exit from the
last field would unprotect the form, remove the watermark, and reprotect the
form with the field contents intact.

So I don't know much about macros. I have (from an old posting) the macro to
unprotect and reprotect the form without erasing the field contents. I have
used it before and know it works fine. I assume I could insert lines to
remove the watermark in the middle of the existing macro.

I tried several times to create a macro that would remove the watermark
using the record feature and keyboard shortcuts. The shortcuts work fine -
the macro records fine - it debugs fine - but when you run the macro, it
doesn't work. It stops at line 3 and complains it can't find the object.

Here is what the recorder did:

ActiveDocument.Sections(1).Range.Select
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.Shapes("WordPictureWatermark1").Select
Selection.Delete
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument

What do I do now? Thanks for any help!

Macro in form by DA

DA
Wed Oct 27 17:53:52 CDT 2004

Hi Ann

If you've only got one image to get rid off, then try
something like this instead.

ActiveDocument.Sections(1). _
Headers(wdHeaderFooterPrimary).Shapes(1).Delete

Hope that helps,
Dennis
>-----Original Message-----
>I created a form for an existing paper form - a simple
half page, one section
>template. The idea is to fill in the fields with a
picture of the original
>paper form as a watermark (as a guide). Before printing
onto the paper form,
>the watermark must be removed. Ideally, one macro that
runs on exit from the
>last field would unprotect the form, remove the
watermark, and reprotect the
>form with the field contents intact.
>
>So I don't know much about macros. I have (from an old
posting) the macro to
>unprotect and reprotect the form without erasing the
field contents. I have
>used it before and know it works fine. I assume I could
insert lines to
>remove the watermark in the middle of the existing macro.
>
>I tried several times to create a macro that would
remove the watermark
>using the record feature and keyboard shortcuts. The
shortcuts work fine -
>the macro records fine - it debugs fine - but when you
run the macro, it
>doesn't work. It stops at line 3 and complains it can't
find the object.
>
>Here is what the recorder did:
>
>ActiveDocument.Sections(1).Range.Select
> ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageHeader
> Selection.HeaderFooter.Shapes
("WordPictureWatermark1").Select
> Selection.Delete
> ActiveWindow.ActivePane.View.SeekView =
wdSeekMainDocument
>
>What do I do now? Thanks for any help!
>
>
>.
>

RE: Macro in form by Ann

Ann
Wed Oct 27 19:47:01 CDT 2004

It worked like a dream. Thank you!

"DA" wrote:

> Hi Ann
>
> If you've only got one image to get rid off, then try
> something like this instead.
>
> ActiveDocument.Sections(1). _
> Headers(wdHeaderFooterPrimary).Shapes(1).Delete
>
> Hope that helps,
> Dennis
> >-----Original Message-----
> >I created a form for an existing paper form - a simple
> half page, one section
> >template. The idea is to fill in the fields with a
> picture of the original
> >paper form as a watermark (as a guide). Before printing
> onto the paper form,
> >the watermark must be removed. Ideally, one macro that
> runs on exit from the
> >last field would unprotect the form, remove the
> watermark, and reprotect the
> >form with the field contents intact.
> >
> >So I don't know much about macros. I have (from an old
> posting) the macro to
> >unprotect and reprotect the form without erasing the
> field contents. I have
> >used it before and know it works fine. I assume I could
> insert lines to
> >remove the watermark in the middle of the existing macro.
> >
> >I tried several times to create a macro that would
> remove the watermark
> >using the record feature and keyboard shortcuts. The
> shortcuts work fine -
> >the macro records fine - it debugs fine - but when you
> run the macro, it
> >doesn't work. It stops at line 3 and complains it can't
> find the object.
> >
> >Here is what the recorder did:
> >
> >ActiveDocument.Sections(1).Range.Select
> > ActiveWindow.ActivePane.View.SeekView =
> wdSeekCurrentPageHeader
> > Selection.HeaderFooter.Shapes
> ("WordPictureWatermark1").Select
> > Selection.Delete
> > ActiveWindow.ActivePane.View.SeekView =
> wdSeekMainDocument
> >
> >What do I do now? Thanks for any help!
> >
> >
> >.
> >
>