CanvasShapes.AddPicture (Word)

Adds a picture to a drawing canvas. Returns a Shape object that represents the picture and adds it to the CanvasShapes collection.

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


Sub NewCanvasPicture() 
 Dim shpCanvas As Shape 
 
 'Add a drawing canvas to the active document 
 Set shpCanvas = ActiveDocument.Shapes _ 
 .AddCanvas(Left:=100, Top:=75, _ 
 Width:=200, Height:=300) 
 
 'Add a graphic to the drawing canvas 
 shpCanvas.CanvasItems.AddPicture _ 
 FileName:="C:\Program Files\Microsoft Office\" & _ 
 "Office\Bitmaps\Styles\stone.bmp", _ 
 LinkToFile:=False, SaveWithDocument:=True 
End Sub

Arguments

The following argument is required

FileName (String) - The path and file name of the picture.

Optional arguments

The following arguments are optional

LinkToFile (Boolean) - 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 (Boolean) - True to save the linked picture with the document. The default value is False.

Left (Long) - The position, measured in points, of the left edge of the new picture relative to the drawing canvas.

Top (Long) - The position, measured in points, of the top edge of the new picture relative to the drawing canvas.

Width (Long) - The width of the picture, in points.

Height (Long) - The height of the picture, in points.