how to search for WordArt in a document

M

muyBN

I teach an online computer class and one of the projects I have my students
do is a Word document with, among other features, WordArt. I’m trying to
macro-automate my correcting of the documents and I need to know how to
detect whether a graphic is a piece of WordArt. My thought is that a search
for “^g†then testing for WordArt properties would be the way to do it, but I
don't know how to test for that property. Any suggestions on either how to
search for WordArt, or to determine if a found graphic is WordArt? Thanks in
advance for any assistance.
 
H

Helmut Weber

Hi Bryan,
Any suggestions

if so:
I couldn't find another way for checking
whether an inlineshape is a WordArt picture,
than this:

Sub Test48800()
Dim oShpNrm As Shape ' normal shape
Dim oShpInl As InlineShape
Dim strTemp As String
For Each oShpNrm In ActiveDocument.Shapes
If oShpNrm.Type = msoTextEffect Then
oShpNrm.Select
MsgBox "WordArt Shape"
End If
Next
For Each oShpInl In ActiveDocument.InlineShapes
If oShpInl.Type = wdInlineShapePicture Then
oShpInl.Select
On Error Resume Next
strTemp = ""
strTemp = oShpInl.TextEffect.Text
If strTemp <> "" Then
MsgBox "WordArt Inlineshape"
End If
End If
Next
End Sub

With shapes it is easy.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

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