VBA Code for selecting a wordart object

J

Jules

Would someone advise the code for selecting a word art image?

Background - users want an on/off button for putting the word "Draft"
in the background of their documents. It needs to be customisable so
they can change it to Confidential etc. which is why its a word art
object. i've put it in the header so it's behind the document. There
are other things in the header so I can't Select all.
 
H

Helmut Weber

Hi,
in case of a shaperange, have a look at this:
With ActiveDocument.StoryRanges(wdPrimaryHeaderStory)
MsgBox .ShapeRange(1).Type ' 15
' msoTextEffect probably WordArt ?
End With
---

Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000
 
J

Jules

Dim sh as shape
Dim rng as Range

Set rng = selection.range

' choose the wordart and formatting

set sh = activedocument.shapes.addtexteffect(msotexteffect1, _
"presettexteffect xx", "arial", 24, false, false, _
0,0, rng)

' send behind text

sh.zorder msoSendBehindText
 

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