467,161 Members | 856 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,161 developers. It's quick & easy.

Insert TIFF formatted file in MS WORDS using VB6

100+
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
Nov 3 '06 #1
  • viewed: 3007
Share:
1 Reply
sashi
Expert 1GB
Hi there,

Are you inserting data to a plain word document or a template (.dot)?

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
Nov 3 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Nicolas Guilhot | last post: by
reply views Thread by Will Arrowsmith | last post: by
reply views Thread by Will Arrowsmith | last post: by
6 posts views Thread by qysbc | last post: by
3 posts views Thread by Andres Corrada-Emmanuel | last post: by
5 posts views Thread by Sameer Gupta | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.