VBA to detect rotation of inline shape

It's only been recently (since 2007?) that Word has allowed us rotate inline shapes. I'm looking for a way for a macro to detect whether such a shape has been rotated; but apparently there's no .Rotation property for the InlineShape object. Any ideas for a way around that (in Word 2010)?

If it helps, the rotation is always either 0 or 90 degrees, so a Boolean function would suffice (that is, there's no need to detect the amount). Unfortunately the shapes are not all of the same aspect ratio or this would obviously be simple.

Thanks for any clues.

Mark


Answer
Answer

The following works with a picture that is inserted inline from the start.

Selection.InlineShapes(1).ConvertToShape
If Selection.ShapeRange.Rotation <> 0 Then
    MsgBox "Rotated"
Else
    MsgBox "Not Rotated"
End If
ActiveDocument.Undo

Hope this helps,
Doug Robbins - MVP Office Apps & Services (Word)
dougrobbinsmvp@gmail.com
It's time to replace ‘Diversity, Equity & Inclusion’ with ‘Excellence, Opportunity & Civility’ - V Ramaswamy

3 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated June 6, 2023 Views 2,407 Applies to: