Results 1 to 2 of 2
2011-10-03, 21:21 #1
- Join Date
- Feb 2002
- Auckland, New Zealand
- Thanked 0 Times in 0 Posts
Identifying objects in Word to format or delete
We currently have a macro that is run when staff wisgh to finalise reports. The macro removes the company logo, as final is printed on preprinted paper, and removes the draft watermark. However, I am wanting to identify specific graphics in a new document, based on the standard template, that does not delete specific graphics from the final report.
I have tried recording a macro to identify the graphic but can only come up with an object number ("Object 14"). Of course this may vary depending on how the document has been edited.
My question is, can I add a reference to a graphic to allow for specific searching/deleting/not deleting.
' If ActiveDocument.Shapes("Object 14") = True Then
' For Each shp In ActiveDocument.Sections(1).Headers(wdHeaderFooterP rimary).Shapes
' If shp.Type = msoTextEffect Then
' shp.Visible = Not shp.Visible
' End If
' Next shp
For Each shp In ActiveDocument.Sections(1).Headers(wdHeaderFooterP rimary).Shapes
If shp.Type = msoTextEffect Then
shp.Visible = Not shp.Visible
The commented out code is the new codecheers
2011-10-04, 00:09 #2
- Join Date
- Feb 2001
- Silicon Valley, USA
- Thanked 93 Times in 89 Posts
Hmmm, I thought a Shape (or InlineShape) had a Tag property, but perhaps that is in PowerPoint? There is an AlternateText property you probably could use for your purposes.