Comparteix a través de


Método Shape.SetShapesDefaultProperties (Excel)

Convierte el formato de la forma especificada en el formato predeterminado de la forma.

Sintaxis

expresión. SetShapesDefaultProperties

expresión Variable que representa un objeto Shape.

Ejemplo

En este ejemplo se agrega un rectángulo a myDocument, se aplica formato al relleno del rectángulo, se establece el formato del rectángulo como formato predeterminado para la forma y, a continuación, se agrega otro rectángulo más pequeño al documento. El segundo rectángulo tiene el mismo relleno que el primero.

Set myDocument = Worksheets(1) 
With myDocument.Shapes 
 With .AddShape(msoShapeRectangle, 5, 5, 80, 60) 
 With .Fill 
 .ForeColor.RGB = RGB(0, 0, 255) 
 .BackColor.RGB = RGB(0, 204, 255) 
 .Patterned msoPatternHorizontalBrick 
 End With 
 ' Set formatting as default formatting 
 .SetShapesDefaultProperties 
 End With 
 ' Create new shape with default formatting 
 .AddShape msoShapeRectangle, 90, 90, 40, 30 
End With

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.