Macro to work on picture

O

Olórin

I'm trying to record a macro to automate something I commonly do with a
newly-inserted picture, namely put it in a "frame" to make it moveable and
resizeable. I do this via: right-click it > Format Picture > Layout tab >
select "Square" Wrapping Style > OK

But once in "recording" mode for the macro, I can't right-click the picture;
and if I use the Word menu to get there, Format > Picture, the "wrapping
style" buttons are inactive, can't be clicked.

Is there a way around this, or can macros just not be applied when a picture
is selected?

Many thanks.
 
H

Helmut Weber

Hi Olórin,

there are limits to recording macros.
Some things just don't work.

Try:

Sub Test400A()
Dim MyShape As Shape
Set MyShape = Selection.InlineShapes(1).ConvertToShape
MyShape.WrapFormat.Type = wdWrapSquare
End Sub

--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP
 
O

Olórin

Helmut Weber said:
Hi Olórin,

there are limits to recording macros.
Some things just don't work.

Try:

Sub Test400A()
Dim MyShape As Shape
Set MyShape = Selection.InlineShapes(1).ConvertToShape
MyShape.WrapFormat.Type = wdWrapSquare
End Sub

--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP


That worked perfectly, Helmut - many thanks!
 

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