bizybeaver
Technical User
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
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