Shape. InlineTextRange,, propriété (Publisher)Shape.InlineTextRange property (Publisher)
Cette propriété renvoie un objet TextRange qui reflète la position de la forme insérée dans la plage de texte qui la contient.Returns a TextRange object that reflects the position of the inline shape in its containing text range. En lecture seule.Read-only.
SyntaxeSyntax
expression. InlineTextRange,expression.InlineTextRange
expression Variable qui représente un objet Shape .expression A variable that represents a Shape object.
RemarquesRemarks
La plage de texte renvoyée contient un seul objet représentant la forme insérée.The returned text range contains a single object representing the inline shape. Une erreur de traitement automatique est renvoyée si la forme n’est pas insérée.An automation error is returned if the shape is not inline.
ExempleExample
L'exemple suivant recherche la première forme (une zone de texte) sur la première page de la composition et détermine si la plage de texte dans la zone de texte contient des formes insérées.The following example finds the first shape (a text box) on the first page of the publication, and determines if the text range within the text box contains inline shapes. Si les formes insérées sont détectés, la propriété InlineTextRange est utilisée pour représenter la forme insérée après l'insertion d'un bloc de texte.If inline shapes are found, the InlineTextRange property is used to represent the inline shape after a block of text is inserted.
Dim theShape As Shape
Dim theTextRange As TextRange
Dim i As Integer
Set theShape = ActiveDocument.Pages(1).Shapes(1)
If Not theShape.IsInline = True Then
With theShape.TextFrame.Story.TextRange
If .InlineShapes.Count > 0 Then
Set theTextRange = theShape.TextFrame.Story.TextRange
For i = 1 To .InlineShapes.Count
With .InlineShapes(i)
.InlineTextRange.InsertAfter (" (Figure " & i & ") ")
End With
Next
End If
End With
End If
Assistance et commentairesSupport and feedback
Avez-vous des questions ou des commentaires sur Office VBA ou sur cette documentation ?Have questions or feedback about Office VBA or this documentation? Consultez la rubrique concernant l’assistance pour Office VBA et l’envoi de commentaires afin d’obtenir des instructions pour recevoir une assistance et envoyer vos commentaires.Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.