Code for setting "In Line with Text" option

B

buncs

Some time ago, I asked how to set/unset the "Float Over Text" FormatObject feature programatically. I never really got an answer I could use. That was WORD97, but I notice now with 2000 that the feature no longer exists. However, I would like to set the "In Line with Text", but if I bring up the Format Object dialog while in Record Macro mode, the "In Line with Text" feature is unselectable (as was "Float Over Text" with WORD97).

How come these features are selectable normally but not when you record? Rather than wade through the Help, I tend to use Record Macro to find out how to code something.

Can anyone tell me how I can programmatically set "In Line with Text".
 
A

Alex Ivanov

rng.InlineShapes.AddPicture ...
rng.InlineShapes.AddOLEControl ...
rng.InlineShapes.AddOLEObject ...

HTH,
Alex.

buncs said:
Some time ago, I asked how to set/unset the "Float Over Text" FormatObject
feature programatically. I never really got an answer I could use. That
was WORD97, but I notice now with 2000 that the feature no longer exists.
However, I would like to set the "In Line with Text", but if I bring up the
Format Object dialog while in Record Macro mode, the "In Line with Text"
feature is unselectable (as was "Float Over Text" with WORD97).
How come these features are selectable normally but not when you record?
Rather than wade through the Help, I tend to use Record Macro to find out
how to code something.
 
J

Jezebel

Recording macros doesn't work for quite a lot of dialogs. You need to write
the code yourself.

You can work programmatically with the dialogs themselves (read help on
Dialogs and the Word Dialog arguments list) - you can read and set the
dialog values, display the dialog, or execute it with displaying it.

But for most purposes it is simpler to work directly with the properties of
the objects. In this case, you want the ConvertToInlineShape method. To
convert the selected shape(assuming it's a shape that can be converted), use

Selection.ShapeRange(1).ConvertToInlineShape




buncs said:
Some time ago, I asked how to set/unset the "Float Over Text" FormatObject
feature programatically. I never really got an answer I could use. That
was WORD97, but I notice now with 2000 that the feature no longer exists.
However, I would like to set the "In Line with Text", but if I bring up the
Format Object dialog while in Record Macro mode, the "In Line with Text"
feature is unselectable (as was "Float Over Text" with WORD97).
How come these features are selectable normally but not when you record?
Rather than wade through the Help, I tend to use Record Macro to find out
how to code something.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top