Shapes.AddPicture Method

Adds a picture to a document. Returns a Shape object that represents the picture and adds it to the Shapes collection.

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

Syntax

'Declaration
Function AddPicture ( _
    FileName As String, _
    ByRef LinkToFile As Object, _
    ByRef SaveWithDocument As Object, _
    ByRef Left As Object, _
    ByRef Top As Object, _
    ByRef Width As Object, _
    ByRef Height As Object, _
    ByRef Anchor As Object _
) As Shape
'Usage
Dim instance As Shapes
Dim FileName As String
Dim LinkToFile As Object
Dim SaveWithDocument As Object
Dim Left As Object
Dim Top As Object
Dim Width As Object
Dim Height As Object
Dim Anchor As Object
Dim returnValue As Shape

returnValue = instance.AddPicture(FileName, _
    LinkToFile, SaveWithDocument, Left, _
    Top, Width, Height, Anchor)
Shape AddPicture(
    string FileName,
    ref Object LinkToFile,
    ref Object SaveWithDocument,
    ref Object Left,
    ref Object Top,
    ref Object Width,
    ref Object Height,
    ref Object Anchor
)

Parameters

  • FileName
    Type: System.String
    Required String. The path and file name of the picture.
  • LinkToFile
    Type: System.Object%
    Optional Object. True to link the picture to the file from which it was created. False to make the picture an independent copy of the file. The default value is False.
  • SaveWithDocument
    Type: System.Object%
    Optional Object. True to save the linked picture with the document. The default value is False.
  • Left
    Type: System.Object%
    Optional Object. The position, measured in points, of the left edge of the new picture relative to the anchor.
  • Top
    Type: System.Object%
    Optional Object. The position, measured in points, of the top edge of the new picture relative to the anchor.
  • Width
    Type: System.Object%
    Optional Object. The width of the picture, in points.
  • Height
    Type: System.Object%
    Optional Object. The height of the picture, in points.
  • Anchor
    Type: System.Object%
    Optional Object. The range to which the picture is bound. If Anchor is specified, the anchor is positioned at the beginning of the first paragraph in the anchoring range. If this argument is omitted, however, the anchor is placed automatically and the picture is positioned relative to the top and left edges of the page.

Return Value

Type: Microsoft.Office.Interop.Word.Shape

See Also

Reference

Shapes Interface

Shapes Members

Microsoft.Office.Interop.Word Namespace