By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,988 Members | 1,493 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,988 IT Pros & Developers. It's quick & easy.

Insert TIFF formatted file in MS WORDS using VB6

100+
P: 126
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
Share this Question
Share on Google+
1 Reply


sashi
Expert 100+
P: 1,754
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.