Nota:
El acceso a esta página requiere autorización. Puede intentar iniciar sesión o cambiar directorios.
El acceso a esta página requiere autorización. Puede intentar cambiar los directorios.
Obtiene un objeto Shape individual de la colección ShapeRange . Forma de solo lectura.
Sintaxis
más sencilla.Valor
expresión Variable que representa un objeto 'ShapeRange'.
Comentarios
El valor es la propiedad predeterminada para un objeto ShapeRange .
Ejemplo
En el ejemplo siguiente se crea un informe denominado "Informe de prueba", se crean dos formas y después se agregan las formas a un objeto ShapeRange . La instrucción que comienza con sRange.Value(1) obtiene la primera forma del rango de formas. La instrucción que comienza con sRange(2) invoca la propiedad Valor predeterminada y obtiene la segunda forma del rango 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
Objeto ShapeRange Objetode forma
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.