I have written a VB6 program extracting Customers Name and address from a table to incorporate it into a letter and output it to MS WORDS. At the bottom of the letter I tried to insert a digitised signature TIFF formatted file. Instead of the signature appearing on each letter generated by WORDS, all the signatures congregated at the last Letter. Being new to VB6 and just don't know what went wrong
Here are sample of the script that insert the TIFF signature file into WORDS.
Private Function FPrintSignature(ByVal iClientId As Long, iWord As Word.Application, iDoc As Word.Document)
'vbcity version
Dim objPic As InlineShape
Dim objPicShape As Word.Shape
Dim strSql As String
Dim strSignPath As String
strSql = "Select * from Signature where ClientId = " & iClientId
adoRstSign.Open strSql, adoConn, adOpenKeyset
With adoRstSign
If Not .EOF Then
strSignPath = .Fields("SignPath")
Set objPic = iDoc.InlineShapes.AddPicture(strSignPath, False, True, iWord.Selection.Range)
Set objPicShape = objPic.ConvertToShape
objPicShape.WrapFormat.Type = WdWrapType.wdWrapNone
objPicShape.WrapFormat.Side = WdWrapSideType.wdWrapBoth
objPicShape.Height = 20
objPicShape.Width = 60Lennie_Kuah@xtra.co.nz
FInsertLine 2
'display fullname and jobtitle
iWord.Selection.TypeText Text:=.Fields("SignatureFullName")
FInsertLine 1
iWord.Selection.TypeText Text:=.Fields("SignatureTitle")
iWord.Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft
End If
End With
Set objPic = Nothing
Set objPicShape = Nothing
Set adoRstSign = Nothing
End Function