Compartilhar via


Shapes.AddPicture Method

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

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Function AddPicture ( _
    Filename As String, _
    LinkToFile As MsoTriState, _
    SaveWithDocument As MsoTriState, _
    Left As Single, _
    Top As Single, _
    Width As Single, _
    Height As Single _
) As Shape
'Usage
Dim instance As Shapes
Dim Filename As String
Dim LinkToFile As MsoTriState
Dim SaveWithDocument As MsoTriState
Dim Left As Single
Dim Top As Single
Dim Width As Single
Dim Height As Single
Dim returnValue As Shape

returnValue = instance.AddPicture(Filename, _
    LinkToFile, SaveWithDocument, Left, _
    Top, Width, Height)
Shape AddPicture(
    string Filename,
    MsoTriState LinkToFile,
    MsoTriState SaveWithDocument,
    float Left,
    float Top,
    float Width,
    float Height
)

Parameters

  • Filename
    Type: System.String

    Required String. The file from which the OLE object is to be created.

  • LinkToFile
    Type: Microsoft.Office.Core.MsoTriState

    Required MsoTriState. The file to link to. Can be one of these MsoTriState constants:

    msoCTrue

    msoFalse To make the picture an independent copy of the file.

    msoTriStateMixed

    msoTriStateToggle

    msoTrue To link the picture to the file from which it was created.

  • Left
    Type: System.Single

    Required Single. The position (in points) of the upper-left corner of the picture relative to the upper-left corner of the document.

  • Top
    Type: System.Single

    Required Single. The position (in points) of the upper-left corner of the picture relative to the top of the document.

  • Width
    Type: System.Single

    Required Single. The width of the picture, in points.

  • Height
    Type: System.Single

    Required Single. The height of the picture, in points.

Return Value

Type: Microsoft.Office.Interop.Excel.Shape

See Also

Reference

Shapes Interface

Shapes Members

Microsoft.Office.Interop.Excel Namespace