Hi all,
The code below inserts a Signature .png image into a word document at a bookmark called "signature". This works fine if the signature is the last shape in the document. If it is not the last shape then it selects the last shape instead. I would appreciate any direction as to how to resize the signature .png image as soon as it is added to the bookmark location.
Sub AddSignaturePNG()
Application.ScreenUpdating = False
'call the signature file
Call FillABookmarkX("signature", "c:\Signature\Signature.png")
'Resize the added signature
PicResizeX
Application.ScreenUpdating = True
End Sub
Sub FillABookmarkX(strBM As String, strText As String)
Dim j As Long
With ActiveDocument
.Bookmarks(strBM).Range _
.InlineShapes _
.AddPicture FileName:=strText
j = ActiveDocument.InlineShapes.Count
.InlineShapes(j).Select
.Bookmarks.Add strBM, Range:=Selection.Range
End With
End Sub
Sub PicResizeX()
Dim PecentSize As Integer
PercentSize = 7
If Selection.InlineShapes.Count > 0 Then
Selection.InlineShapes(1).ScaleHeight = PercentSize
Selection.InlineShapes(1).ScaleWidth = PercentSize
Else
Selection.ShapeRange.ScaleHeight Factor:=(PercentSize / 100), _
RelativeToOriginalSize:=msoCTrue
Selection.ShapeRange.ScaleWidth Factor:=(PercentSize / 100), _
RelativeToOriginalSize:=msoCTrue
End If
End Sub