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)
Syntax
'Declaration
Function AddPicture ( _
FileName As String, _
ByRef LinkToFile As Object, _
ByRef SaveWithDocument As Object, _
ByRef Range As Object _
) As InlineShape
'Usage
Dim instance As InlineShapes
Dim FileName As String
Dim LinkToFile As Object
Dim SaveWithDocument As Object
Dim Range As Object
Dim returnValue As InlineShape
returnValue = instance.AddPicture(FileName, _
LinkToFile, SaveWithDocument, Range)
InlineShape AddPicture(
string FileName,
ref Object LinkToFile,
ref Object SaveWithDocument,
ref Object Range
)
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.
- Range
Type: System.Object%
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.
Return Value
Type: Microsoft.Office.Interop.Word.InlineShape
Remarks
This method returns a Shape object that represents the picture and adds it to the InlineShapes collection.