• Status: Solved
  • Priority: High
  • Security: Public
  • Views: 38
  • Last Modified:

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 Hermle
Andreas Hermle
2 Solutions
NorieVBA ExpertCommented:

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.


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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now