Hello ChrisMattock,
Although this code was written for Excel, Word shares the StdPicture object. Add your inline object, and then use this macro to load the picture into it, and automatically resize it. Be sure strLogo includes the file extension.
'Written: July 31, 2007
'Author: Leith Ross
'Summary; Change the size of shape to match the picture it will display
Sub AutoSizeShapeToPicture(ByVal Shape_Name As String)
Dim Pic As StdPicture
FileName = ThisWorkbook.Path & "\templates\" & strLogo
Set Pic = LoadPicture(FileName)
' Convert from himteric to inches
With ActiveSheet.Shapes(Shape_Name)
.Height = Pic.Height / 25.4
.Width = Pic.Width / 25.4
.Fill.UserPicture FileName
End With
End Sub
Sincerely,
Leith Ross
Bookmarks