Nota
O acceso a esta páxina require autorización. Pode tentar iniciar sesión ou modificar os directorios.
O acceso a esta páxina require autorización. Pode tentar modificar os directorios.
Obtiene un objeto Shape individual de la colección ShapeRange . Forma de solo lectura.
Sintaxis
expresión. Valor
expresión Variable que representa un objeto 'ShapeRange'.
Observaciones
Value es la propiedad predeterminada de un objeto ShapeRange .
Ejemplo
En el ejemplo siguiente se crea un informe denominado "Informe de prueba", se crean dos formas y, a continuación, se agregan las formas a un objeto ShapeRange . La instrucción que comienza con sRange.Value(1) obtiene la primera forma del intervalo de formas. La instrucción que comienza con sRange(2) invoca la propiedad Value predeterminada y obtiene la segunda forma del intervalo de formas.
Sub TestShapeRangeValue()
Dim theReport As Report
Dim textShape1 As shape
Dim textShape2 As shape
Dim reportName As String
Dim sRange As ShapeRange
reportName = "Test Report"
Set theReport = ActiveProject.Reports.Add(reportName)
Set textShape1 = theReport.Shapes.AddTextbox(msoTextOrientationHorizontal, 30, 50, 350, 80)
textShape1.Name = "Text box 1"
Set textShape2 = theReport.Shapes.AddTextbox(msoTextOrientationHorizontal, 30, 130, 350, 80)
textShape2.Name = "Text box 2"
Set sRange = theReport.Shapes.Range(Array("Text box 1", "Text box 2"))
sRange.TextFrame2.AutoSize = msoAutoSizeShapeToFitText
sRange.Value(1).TextFrame2.TextRange.Text = "This is a test. It's only a test."
sRange(2).TextFrame2.TextRange.Text = "This is text box 2."
End Sub
Valor de propiedad
FORMA
Vea también
ShapeRange (objeto deforma del objeto)
Soporte técnico y comentarios
¿Tiene preguntas o comentarios sobre VBA para Office o esta documentación? Vea Soporte técnico y comentarios sobre VBA para Office para obtener ayuda sobre las formas en las que puede recibir soporte técnico y enviar comentarios.