by Linda Quinn
Close Window

Shapes are all the objects that can be placed on a slide.

Shapes Collection
Slide.Shapes.AddShape . . .



AutoShapes
     sld1.Shapes.AddShape [type, left, top, width, height]

AutoShapes are rectangles, circles, callouts, arrows, stars, flowchart shapes and more.

Add a rectangle shape at left 50, top 50 width 100 and height 200 points.
sld1.Shapes.AddShape msoShapeRectangle, 50, 50, 100, 200

Add a 5 point star shape at left 50, top 200 width 200 and height 200 points.
sld1.Shapes.AddShape msoShape5pointStar, 200, 50, 200, 200

Add a SmileyFace.
sld1.Shapes.AddShape msoShapeSmileyFace, 500, 50, 200, 200



Picture
     sld1.Shapes.AddPicture [FileName, LinkToFile, SaveWithDocument, left, top, width, height]

Add a picture at left 50, top 50 width 100 and height 200 points.
sld1.Shapes.AddPicture FileName:="C:\pict.jpg", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:-50, Top:=150, Width:=200, Height:=200

Adding a picture to a page requires the path and name of the image file.
You must also enter the LinkToFile value, which is True if you want to link to the original image, or False if not.
The SaveWithDocument value is also required. This must be True if LinkToFile is False.


TextBox
     sld1.Shapes.AddTextBox [Orientation, left, top, width, height]

sld1.Shapes.AddTextbox(Type:=msoTextOrientationHorizontal, Left:=100, Top:=100, Width:=200, Height:=50).TextFrame.TextRange.Text = "Test Box"



=================================================================
This content was created by Linda Quinn of LQNet.

See http://www.lqnet.com for a great collection of articles on this and other topics.

=================================================================
Copyright © 2006-2008, LQ Systems,Inc. All rights reserved.


====================================================================
Want an expert to help with your project?    LQ Systems, Inc.   Business Solutions
====================================================================