dunnerca said:
I am trying to insert a picture (signature bmp file) at a specific
bookmark in my template. I can get the file inserted and change the
size; however, I cannot get it to be inserted at the bookmark that I
have specified. Any ideas? Thanks.
You need to include the optional parameter named Range in the AddPicture
command, and pass it the range of the desired bookmark.
Inserting the picture at the bookmark will destroy the bookmark, so you also
need to reinsert that. Here's sample code:
Dim myRange As Range
Dim ILS As InlineShape
Dim ratio As Single
Set myRange = ActiveDocument.Bookmarks("bk1").Range
Set ILS = ActiveDocument.InlineShapes.AddPicture( _
FileName:="C:\My Pictures\something.jpg", _
Range:=myRange)
With ILS
ratio = InchesToPoints(2.5) / .Width
.Width = ratio * .Width
.Height = ratio * .Height
End With
ActiveDocument.Bookmarks.Add Name:="bk1", Range:=myRange
--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.