-
Easy one to get started
Hi all, I have a 199 page document that I need to 'process'. I used to be fairly handy with macros but haven't touched them for 10years + so a little rusty. The document is a PDF that has been imported to word so won't be 'set up' in a standard way.
First job - there is a watermark on each page that I need to get rid of. It s not in 'master pages' but rather appears as a different image on each page.
I've recorded a macro to get started and it seems that the image is called Picture <X> with x being incremented on each page .... so what I want is along the lines of:
For x = 1 To 199 ActivePage.Shapes("Picture" & x).Select
Selection.ShapeRange.Delete
Application.Browser.Next
next x
You might not be surprised to hear that this doesn't work. The error returned is RunTime error 424: Object Required.
Any thoughts?
-
I don't do much Word, but assuming the rest of your Properties are correct, the No Object error, suggests that you need to declare the Object those Properties are "Childs" of
Maybe something like
Code:
For x = 1 to 199
ActiveDoc.Shapes("Picture" & x).ShapeRange.Delete '<-- I dunno "ActiveDoc is right
Next
-
Code:
For x = 1 to 199
ActiveDocument.Shapes("Picture" & x).Delete
Next
-
-
Great - solution found
Quote:
Originally Posted by
macropod
Code:
For x = 1 to 199
ActiveDocument.Shapes("Picture" & x).Delete
Next
Yes, that worked perfectly. It's highlighted a different problem (for me) but the code worked like a charm. Thank you, I really appreciate it