Word

Convert Shape to InlineShape and vice verca

Ease of Use

Easy

Version tested with

2000, 2002 

Submitted by:

MOS MASTER

Description:

One procedure to convert a Shape to a InlineShape and one Procedure to convert a InlineShape to a Shape. 

Discussion:

Sometimes you've inserted a Shape to your document and you'd really wanted a InlineShape instead. These methods provide an easy way to convert them. 

Code:

instructions for use

			

Option Explicit ' \\ This sub will convert a InlineShape to a Shape Sub ConvertToShape() With Selection ' \\ If we selected a InlineShape then convert to Shape If .Type = wdSelectionInlineShape Then .InlineShapes(1).ConvertToShape End If End With End Sub ' \\ This sub will convert a Shape to a InlineShape Sub ConvertToInlineShape() With Selection ' \\ If we selected a Shape then convert to InlineShape If .Type = wdSelectionShape Then .ShapeRange(1).ConvertToInlineShape End If End With End Sub

How to use:

  1. Open your Word document.
  2. Press Alt + F11 to open VBE.
  3. Insert-Module. (Insert -> module)
  4. Paste the code there in the window at right. (F7)
  5. Close VBE (Alt + Q or press the X in the top right hand corner).
  6. Save the file.
 

Test the code:

  1. Select a Shape or InlineShape in the document
  2. From Word, press Alt + F8 to open the macro dialog box.
  3. Select ConvertToInlineShape to convert a Shape
  4. Select ConvertToShape to convert a InlineShape
  5. Click Run.
 

Sample File:

Convert (inline) Shapes.zip 15.05KB 

Approved by mdmackillop


This entry has been viewed 89 times.

Please read our Legal Information and Privacy Policy
Copyright @2004 - 2020 VBA Express