NEWS & TECH BLOG
Signatures in templates
08/09/2015 – in GoldMine, TechniquesI’ve been having a look at signatures in templates. The standard GoldMine signature macro in the Word link will allow you to pull in your own signature bitmap but, unlike the other merge fields, this one insists that you do this manually when the letter is created and won’t pull it in automatically.
This is clearly not quite how we’d like it to work! What we want is for the link to automatically pull in the appropriate bitmap for whichever user is creating the merged document.
What you’ll need to do is to create a macro in Word so that you can insert some special code into the templates (only the person creating the templates needs to do this, not the people using them). You should see a Macro button under the View tab in Word; if not, do a quick Google search for how to get to it. I’m using Word 2010 and not everything is in the same place in different versions.
First, type ‘InsertGmSig’ into the name box and then click Create. This will take you to a page with some code on it. There may be other macros in there but you can ignore them; just delete everything that Word has already put in for InsertGmSig and replace it with:
Sub InsertGmSig()
Application.ScreenUpdating = False
ActiveWindow.View.ShowFieldCodes = True
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:="DDE GOLDMINE DATA &UserName \* CHARFORMAT", PreserveFormatting:=False
Selection.PreviousField
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, PreserveFormatting:=False
Selection.TypeText Text:="INCLUDEPICTURE " + Chr(34) + "\\\\canonbury\\goldmine\\template\\signatures\\"
Selection.NextField
Selection.Collapse direction:=wdCollapseEnd
Selection.TypeText Text:=".bmp" + Chr(34) + " \*MERGEFORMAT\d"
Selection.Collapse direction:=wdCollapseEnd
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.PreviousField.Update
ActiveWindow.View.ShowFieldCodes = False
Application.ScreenUpdating = True
End Sub
Change “\\\\canonbury\\goldmine\\template\\signatures\\” to your own signatures path. Note that each \ is doubled, so \ becomes \\.
Click the save button and then close that page.
Each user’s signature file must be in BMP format, it must have the name format USER.BMP (so, in my case, ROB.BMP), and it must reside in the path that you’ve defined above.
To use the macro, simply put your cursor where you want the signature to be inserted into the template and run the macro (view > macros > view macros > run) to insert it. Then, when a user uses that template, it will go and find his or her signature file and insert it into the document.