Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Shapes.AddPicture Method

Office 2007
Creates a picture from an existing file. Returns a Shape object that represents the new picture.

Syntax

expression.AddPicture(FileName, LinkToFile, SaveWithDocument, Left, Top, Width, Height)

expression   A variable that represents a Shapes object.

Parameters

NameRequired/OptionalData TypeDescription
FileNameRequiredStringThe file from which the OLE object is to be created.
LinkToFileRequiredMsoTriStateDetermines whether the picture will be linked to the file from which it was created.
SaveWithDocumentRequiredMsoTriStateDetermines whether the linked picture will be saved with the document into which it is inserted. This argument must be msoTrue if LinkToFile is msoFalse.
LeftRequiredSingleThe position, measured in points, of the left edge of the picture relative to the left edge of the slide.
TopRequiredSingleThe position, measured in points, of the top edge of the picture relative to the top edge of the slide.
WidthOptionalSingleThe width of the picture, measured in points.
HeightOptionalSingleThe height of the picture, measured in points.

Return Value
Shape

Example

This example adds a picture created from the file Music.bmp to myDocument. The inserted picture is linked to the file from which it was created and is saved with myDocument.

Visual Basic for Applications
Set myDocument = ActivePresentation.Slides(1)
myDocument.Shapes.AddPicture FileName:="c:\microsoft office\" & _
    "clipart\music.bmp", LinkToFile:=msoTrue, SaveWithDocument:=msoTrue, _
    Left:=100, Top:=100, Width:=70, Height:=70



Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.