How can I ask Word to FIND any WordArt object in a header?

A

auntieono

I am attempting to write a macro that will find and remove WordArt objects in
the headers of a document. I currently have a macro that inserts them, but I
would like to be able to allow users to undo and remove them.

Simply recording the macro has Word finding specific WordArt objects [it
numbers them as it puts them into a document], and I would like to figure out
how to get it to find ANY WordArt and then delete.
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?YXVudGllb25v?=,
I am attempting to write a macro that will find and remove WordArt objects in
the headers of a document. I currently have a macro that inserts them, but I
would like to be able to allow users to undo and remove them.
Does this get you started?

Dim rng As Word.Range
Dim shp As Word.Shape

Set rng = ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range
For Each shp In rng.ShapeRange
If shp.Type = msoTextEffect Then
'It's WordArt
End If
Next shp


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top