View Single Post
 
Old 12-11-2013, 03:28 PM
fumei fumei is offline Windows 7 64bit Office XP
Expert
 
Join Date: Jan 2013
Posts: 440
fumei is on a distinguished road
Default

maxInCO, macropod is talking about something like this:
Code:
Sub UpdateBM2(strBM As String, strImageName As String)
Dim r As Range
 Set r = ActiveDocument.Bookmarks(strBM).Range
 r.InlineShapes.AddPicture FileName:=strImageName, LinkTofile:=False
 ActiveDocument.Bookmarks.Add Name:=strBM, Range:=r
End Sub
Sub InsertTheSignature()
Call UpdateBM2("SignatureHere", "c:\TestDocs\Signature1.jpg")
End Sub
The first subroutine is a generic procedure that allows you to insert an image into a bookmark (named "SignatureHere" in this case), without deleting that bookmark. You need to do this in order to permit multiple replacements into a bookmark. It is important to understand that this functions REGARDLESS of where the bookmark is. Placement and position is irrelevant, the code puts the image in the bookmark, period.

The second procedure (InsertTheSignature) calls the insertion procedure with the variable of the image file. Needless to say it would also be possible to have a process to get the file name by user input, or a list of signature that you can select.

You can of course change the parameters like LinkToFile, SaveWithDocument of AddPicture.

And, as macropod mentions you can use the converttoshape method to apply text-wrapping
Reply With Quote