Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems inserting image into Word doc using VBA

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
Code:
        .Selection.InlineShapes.AddPicture FileName:= _
        "F:\Marketing\Graphics & Logos\OHC Blue Logo smaller2.jpg", LinkToFile:= _
        False, SaveWithDocument:=True
        [COLOR=red].Selection.InlineShapes(1).Height = 36[/color]
        .Selection.InlineShapes(1).Width = 156
Error is:
5941 The requested member of the collection does not exist

How do I select the newly added image? or

TIA


DougP, MCP, A+
[r2d2] I Built my own R2D2
I love this site and all you folks that helped me over the years!
 
This is probably more suited to forum707, however, you need ActiveDocument, rather than Selection and the first InlineShape is 0 (zero) not 1 (one).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top