Inline–Floating hybrid graphics in Word 2002

Article contributed by Suzanne S. Barnhill, Dave Rado, and Bill Coan

1.   In Word 2002, if you go into Print Layout View, and select an Inline graphic, you can rotate it, by clicking the Rotate Left button on the Picture toolbar! Once you have done so, the picture looks like a floating graphic, and acquires a rotation handle; and you can then rotate it to any angle, using the handle, or by specifying an angle on the Size tab of the Format | Picture dialog, or by selecting one of the Rotate or Flip options on the Draw menu on the Drawing toolbar. However, the resulting graphic claims to be Inline, according to the Wrapping tab under Format | Picture; and if you switch back to Normal View, you will see a blank rectangular Inline graphic marking its position. In other words, it's a strange hybrid, part Floating, part Inline.

This is (probably) by design. Only probably, because it is not documented either in the Help files, or in the Microsoft Knowledge Base, and because until you do click the Rotate Left button, all other rotation options are disabled.

2.   If you select an ordinary Inline graphic while in Normal View, you can also rotate it by clicking the Rotate Left button ; but if you do, the graphic disappears! It doesn't become invisible; it just goes up in a puff of smoke, never to be seen again – for instance, if you start with one Inline shape in the document, and rotate it, both of the following VBA lines return 0:

MsgBox ActiveDocument.InlineShapes.Count
MsgBox ActiveDocument.Shapes.Count

This is definitely a bug.

So let's start in Print Layout view and take a closer look at what happens if we rotate an Inline graphic.

Having clicked the Rotate Left button, you will see that its sizing handles look like those of a conventional Floating graphic. If you click on it, select Format | Picture, and look at the Text Wrapping, it claims to be In line with text. If you display field codes (Alt+F9) you will see that the graphic is now a field! The field looks like this:

{ SHAPE \* MERGEFORMAT }

Unfortunately, the Shape field is not documented in the Word 2002 Help files.

And the following code returns:

MsgBox ActiveDocument.InlineShapes.Count   'Returns 0
MsgBox ActiveDocument.Shapes.Count           'Returns 1

Which means that as far as VBA is concerned, it's Floating.

So it's a hybrid! A cross between Inline and Floating – and even Word itself doesn't know which it really is!

Now, switch to Normal View, and you will you will see a blank rectangular placeholder marking the position of your graphic. If you click on this rectangle, you will see that to all intents and purposes, it's an imageless Inline picture.

So what happens if you open the document in Word 2000?

If you open a document in Word 2000 that contains a rotated Inline picture created in Word 2002, then what you get in Word 2000 is an unrotated Floating picture – but its sizing handles are rotated!


Figure 2: The same Inline picture as it appears when opened in Word 2000

This (Floating) picture is actually superimposed on top of a blank, rectangular Inline picture, identical to the one you see in Word 2002 when in Normal View. In Word 2000, however, you can see the Inline graphic that it's been superimposed on top of while you are in Print Layout View, either by selecting and deleting the Floating graphic, which leaves the Inline one behind it in place; so that you can select it:


Figure 3: The hidden (truly Inline) placeholder graphic

... or by selecting Format | Picture and changing the position measurements of the Floating graphic; which moves the Floating picture, but leaves the Inline one where it was, so that you can select it.

And the following code returns:

MsgBox ActiveDocument.InlineShapes.Count   'Returns 1
MsgBox ActiveDocument.Shapes.Count           'Returns 1

So Word 2000 considers there to be both an Inline and a Floating graphic present.

In Normal View, Word 2000, just like Word 2002, only displays the Inline shape placeholder.

So under the bonnet, even in Word 2002, it would seem reasonable to conclude that you also have a Floating picture superimposed on top of a blank, truly Inline picture, and that the latter is there to mark the position of the graphic when in Normal view; but in Word 2002, both the User Interface and VBA mask the existence of the truly Inline picture.

In Word 2000, if you select Format | Picture | Layout | Advanced, you will see that the Floating shape's position is set horizontally relative to character, and vertically relative to line; and Move object with text, Lock anchor, and Allow overlap are all selected. This is why it can appear in the middle of a line. in Word 2000, and why it behaves more or less like an Inline picture in most other respects, except for one major one: that being that it slows your document down considerably in comparison with a true Inline picture, as, of course, Floating graphics always do.

So what happens if you open the document in Word 97?

When you open the same document in Word 97, again you get an unrotated Floating picture whose sizing handles are rotated. But this time, it is not superimposed on the Inline picture, so you can see both the Floating and the Inline picture in Page Layout view; the Floating picture has moved to the left edge of the column and may be covering up some of your text: The reason for this is that relative to character, and relative to line are not supported in Word 97; and its position is set horizontally to 0 relative to column, and vertically to 0 relative to paragraph.


Figure 4: The same rotated picture as it appears when opened in Word 97

As with Word 2000, in Normal view, you can only see the blank Inline placeholder graphic.

Summary

Rotated Inline pictures in Word 2002 are a hybrid, part Inline and part Floating. Only the Inline element is visible when in Normal View; only the Floating element is visible when in Print Layout View. If you turn on field codes it turns out to be a Shape field. As far as the Word object model in VBA is concerned, it's a Floating picture; but the Text Wrapping says it's Inline.

Rotating an Inline picture (rather than rotating a Floating one) has the advantage that you get a placeholder when in Normal View, and also that the Position settings are set up for you such that in most respects it behaves like an Inline picture (although it slows down documents as much as a normal Floating graphic does).

However, if you do use rotated Inline pictures in your Word 2002 documents, you must be aware that you will lose back-compatibility with earlier versions of Word; you must be careful not to do the rotating while in Normal View, or your picture will go poof!; and given that this is an undocumented feature, use it at your own risk, if at all, and do so warily!