473,383 Members | 1,725 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Insert TIFF formatted file in MS WORDS using VB6

126 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
1 3192
sashi
1,754 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

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

Similar topics

0
by: Nicolas Guilhot | last post by:
Hi all ! I have a multi-page Tiff image file that I want to convert to PDF. To do so I am using iText library. The conversion is working, but the code execution is very different according to...
0
by: Will Arrowsmith | last post by:
Hi All, I am trying to create a .tiff file to fax using the windows fax service FAXCOMLib. I have created an array of images (bitmaps) and converted them to 1pbb format in order to allow...
0
by: Will Arrowsmith | last post by:
Hi All, I am aiming to create a multiframe Tiff file that I can fax using the windows fax service FAXCOMLib. I have created an array of Bitmaps (pages I want in my fax doc) and succesfully...
5
by: Shane Story | last post by:
I can seem to get the dimensions of a frame in a multiframe tiff. After selecting activeframe, the Width/Height is still really much larger than the page's actual dimensions. When I split a...
6
by: qysbc | last post by:
I have a web page and there is a link to open a TIFF file. The way I do it is to have the server code open a binary stream, set the content type to "image/tiff" and call Response.BinaryWrite. On...
3
by: Andres Corrada-Emmanuel | last post by:
Hello, I have installed PIL 1.1.5 on Windows with Python 2.4. I'm unable to open .tiff images that I can open and view using Windows Explorer. In other words, this simple test fails: import...
5
by: Sameer Gupta | last post by:
what are options for opening / handling tiff files in .Net framework ? which is the best library, namespace ? Please help Regards Sameer Gupta C# Designer & Developer Siemens UK
7
by: Ben | last post by:
Hi We are looking for a component that offers that offers the below for Tiff files: Image clean-up (deskew, despeckle) Printing capabilities from VB The ability to add text to image, e.g....
1
by: BuncyTheFrog | last post by:
Working in C# in Visual Studio 2005 So I know how to edit TIFF tags (get a propertyItem object, edit its details, and stick it into a bitmap), but saving them is presenting itself as a problem. ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.