format all graphics as in-line with text using VBA

Dear Experts:

I got a long document with hundreds of graphics.

I would like to format all of them as in-line with text ('wrap-text' option.) in one go using a macro.

Lots of them also have this wrap-text option (i.e. in-line with text) but dozens of them have another one such as 'In-Front of Text'.

Help is much appreciated. Thank you very much in advance.

Regards, Andreas
Andreas HermleTeam leaderAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NorieAnalyst Assistant Commented:

Do you mean you want them formatted as in-line with text only?
Andreas HermleTeam leaderAuthor Commented:
yes, Norie, exactly. Thank you ...
Hi Andreas,
Try this
Sub ToInline()
    Dim sh As Shape
    For Each sh In ActiveDocument.Shapes
        If sh.Type = msoPicture Then
        End If
    Next sh
End Sub

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.


pls try
Sub Macro()
   Dim oshp As Shape
    For Each oshp In ActiveDocument.Shapes
End Sub

Open in new window

Andreas HermleTeam leaderAuthor Commented:
Dear both,

thank you very much for your swift help.

I can use both. As a matter of fact, if I run the one or the other, there are always a couple of graphics that still have the 'tight' text wrap option.

But if I run both codes one after the other, then everything gets changed. Strange isn't it? Somebody inserted the graphics from a lot of different sources (internet, screenshots, graphic files etc.). Maybe the document is messed up a little bit.

Anyhow I suggest splitting the points between you two.
Andreas HermleTeam leaderAuthor Commented:
Thank you very much for your professional help.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Word

From novice to tech pro — start learning today.