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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AddPicture and Sent to Back

Status
Not open for further replies.

bizybeaver

Technical User
Apr 7, 2004
26
US
I need to insert a graphic then further format it. However, for some reason, once a picture is inserted, I lose "focus" and can't control it. I've looked everywhere and even some archived posts here, and they don't work. I've copied one. Mostly, if I could figure out how to name a Shape while I create it, that would probably do it, but so far, I can't get the .Name to work.

Sub InsertCover()

Dim Shp As Shape
Set Shp = ActiveDocument.Shapes.AddPicture(FileName:="G:\Pic.jpg", LinkToFile:=False, SaveWithDocument:=True)
With Shp
.Name = "Cover"
.ZOrder msoSendToBack
'.RelativeHorizontalPosition = wdRelativeHorizontalPositionPage
'.Top = (0)
'.Left = 0)
'.Width = (612)
'.Height = (792)
End With


End Sub

Mostly, I just need to control the graphic one time, resize, send to back, etc... But for some reason, when I try to execute the code, it grabs other objects or shapes, if I take out the .Name
 
Look at .OLEFormat, and then .Object for Shp.

Also you can try to convert it to an InlineShape.

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top