An inline shape is an object that is in the text layer of the document.
An inline shape can only be a picture, an OLE Object or an ActiveX control.
Represents a object in the text layer of the document.
InlineShapes do not have names.
InlineShape objects are treated like characters and are positioned as characters within a line of text.
The Inlineshapes collection represents all the inline shapes in the document, range or selection.
The Count property for the InLineShapes collection in a document returns the number of shapes in the main story only.
If you want to count the number of inline shapes in other areas then use must use a Range object.
Use the new method to create a new picture as an inline shape
You can use the AddPicture and AddOleObject methods to add pictures or OLE Objects and link them to the source file.
Use the AddOleControl to add an Active X control.
Dim objInlineShape As Word.InlineShape
Dim objshape As Word.Shape
objShape = objInlineShape.ConvertToShape
objInlineShape = objShape.ConvertToInlineShape
Use this property to return the type of the Inline Shape
objInlineShape.Type = wdInlineShapeType.wdInlineShapePicture
The InlineShape object is a member of the InlineShapes collection.
The InlineShapes collection contains all the shapes in a document, range, or selection.
Use InlineShapes(index), where index is the index number, to return a single InlineShape object.
Inline shapes don't have names.
The following example activates the first inline shape in the active document.
This example saves the linked picture that's defined as the first inline shape in the active document when the document is saved.
Set myPic = ActiveDocument.InlineShapes(1)
If myPic.Type = wdLinkType.wdInlineShapeLinkedPicture Then
This represents all the InlineShape objects
This example inserts a graphic as an inline shape (using an INCLUDEPICTURE field) and then displays the shape's field code.
Dim ishapeNew As InlineShape
Set iShapeNew = _
Indicates if an InlineShape object is a picture bullet. Read-only.
Although picture bullets are considered inline shapes, searching a document's InlineShapes collection will not return picture bullets.
This example formats the selected list if the list if formatted with a picture bullet. If not, a message is displayed.
Public Sub IsSelectionAPictureBullet(shp As InlineShape)
On Error GoTo ErrorHandler
If shp.IsPictureBullet = True Then
shp.Width = InchesToPoints(0.5)
shp.Height = InchesToPoints(0.05)
MsgBox "The selection is not a list or " & _
"does not contain picture bullets."
Use the following code to call the routine above.
© 2020 Better Solutions Limited. All Rights Reserved. © 2020 Better Solutions Limited TopPrevNext