Share via


InlineShapes.AddPicture Method 

Adds a picture to a document.

Namespace: Microsoft.Office.Interop.Word
Assembly: Microsoft.Office.Interop.Word (in microsoft.office.interop.word.dll)

Usage

Dim FileName As String
Dim LinkToFile As Object
Dim SaveWithDocument As Object
Dim Range As Object
Dim returnValue As InlineShape
Dim inlineShapes1 As InlineShapes
returnValue = inlineShapes1.AddPicture(FileName, LinkToFile, SaveWithDocument, Range)

Syntax

Function AddPicture( _
    <InAttribute()> ByVal FileName As String, _
    <InAttribute()> Optional ByRef LinkToFile As Object, _
    <InAttribute()> Optional ByRef SaveWithDocument As Object, _
    <InAttribute()> Optional ByRef Range As Object _
) As InlineShape
InlineShape AddPicture(
    [In] string FileName, 
    [In, Optional] ref object LinkToFile, 
    [In, Optional] ref object SaveWithDocument, 
    [In, Optional] ref object Range
);
public: InlineShape^ AddPicture(
    String^ FileName, 
    &Object^ LinkToFile, 
    &Object^ SaveWithDocument, 
    &Object^ Range
);
public InlineShape AddPicture(
    /*in*/System.String FileName, 
    /*in*/System.Object LinkToFile, 
    /*in*/System.Object SaveWithDocument, 
    /*in*/System.Object Range
);
function AddPicture(
     FileName : String, 
     LinkToFile : Object, 
     SaveWithDocument : Object, 
     Range : Object
) : InlineShape;

Parameters

  • FileName
    Required String. The path and file name of the picture.
  • LinkToFile
    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
    Optional Object. True to save the linked picture with the document. The default value is False.
  • Range
    Optional Object. The location where the picture will be placed in the text. If the range isn't collapsed, the picture replaces the range; otherwise, the picture is inserted. If this argument is omitted, the picture is placed automatically.

Remarks

This method returns a Shape object that represents the picture and adds it to the InlineShapes collection.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms

See Also

Reference

InlineShapes Interface
Microsoft.Office.Interop.Word Namespace

Other Resources

InlineShapes Members