Originally Posted by
Cosmo
Creating a new shape will use the default properties for that shape. If you want it to always be a certain color (or change any other property) when you run the code, then you should set the properties after creating it.
[vba] Dim shp As Shape
Set shp = myDocument.Shapes.AddShape(msoShapeRectangle, 570, 0, 150, 100)
shp.Fill.ForeColor.RGB = RGB(255, 0, 0)
[/vba]
If you have multiple properties you can set them like this:
[vba]
Dim shp As Shape
Set shp = myDocument.Shapes.AddShape(msoShapeRectangle, 570, 0, 150, 100)
with shp
.Fill.ForeColor.RGB = RGB(255, 0, 0)
.Height = 200
'... and any other properties here
end with
[/vba]
Otherwise, your script will always use whatever are set as the default shape properties when the script runs.