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

x
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:
Andreas

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

Open in new window

0

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.

Rgonzo1971Commented:
Hi,

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

Open in new window

0
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.
0
Andreas HermleTeam leaderAuthor Commented:
Thank you very much for your professional help.

Andreas
0
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.