473,621 Members | 2,745 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Insert TIFF formatted file in MS WORDS using VB6

126 New Member
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.Applicatio n, 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("SignPa th")

Set objPic = iDoc.InlineShap es.AddPicture(s trSignPath, False, True, iWord.Selection .Range)
Set objPicShape = objPic.ConvertT oShape

objPicShape.Wra pFormat.Type = WdWrapType.wdWr apNone
objPicShape.Wra pFormat.Side = WdWrapSideType. wdWrapBoth

objPicShape.Hei ght = 20
objPicShape.Wid th = 60Lennie_Kuah@xtr a.co.nz
FInsertLine 2

'display fullname and jobtitle
iWord.Selection .TypeText Text:=.Fields(" SignatureFullNa me")
FInsertLine 1
iWord.Selection .TypeText Text:=.Fields(" SignatureTitle" )

iWord.Selection .ParagraphForma t.Alignment = wdAlignParagrap hLeft

End If

End With

Set objPic = Nothing
Set objPicShape = Nothing
Set adoRstSign = Nothing

End Function
Nov 3 '06 #1
1 3205
sashi
1,754 Recognized Expert Top Contributor
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.Applicatio n, 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("SignPa th")

Set objPic = iDoc.InlineShap es.AddPicture(s trSignPath, False, True, iWord.Selection .Range)
Set objPicShape = objPic.ConvertT oShape

objPicShape.Wra pFormat.Type = WdWrapType.wdWr apNone
objPicShape.Wra pFormat.Side = WdWrapSideType. wdWrapBoth

objPicShape.Hei ght = 20
objPicShape.Wid th = 60Lennie_Kuah@xtr a.co.nz
FInsertLine 2

'display fullname and jobtitle
iWord.Selection .TypeText Text:=.Fields(" SignatureFullNa me")
FInsertLine 1
iWord.Selection .TypeText Text:=.Fields(" SignatureTitle" )

iWord.Selection .ParagraphForma t.Alignment = wdAlignParagrap hLeft

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
17917
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 wich iTextSharp.text.Image.getInstance(...) signature I am using : - using code 1 below, the conversion is fast enough but the resulting PDF file is too big (1 817ko sample Tiff file is converted in less than 30 seconds to a 2 764ko PDF file) -...
0
2004
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 CCITT3/4 compression for faxing. The .Tiff file appears to be created successfully however when I try to send the file as a fax I get the error: System.Runtime.InteropServices.COMException (0x8007000D): The data is
0
1688
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 converted them all to be 1bppIndexed. I then combine all bitmaps into a single multiframed Tiff file (with CCITT3 compression) before attempting to fax the file. When I call the send method of the fax routine I get the error:
5
5977
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 TIFF to several PNG files this causes a problem, becuase the resulting image is (the page to the far left and a lot of black space surrounding it and a filesize that is larger than needed. Any ideas?
6
10023
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 the client machine, the file type TIFF is associated with Kodak Imaging Preview. This app works on most client machines. When you click on the link, Kodak Imaging Preview will open the TIFF file on the client machine. However, on some machines, the...
3
6660
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 Image im = Image.open('small.tif') with an 'cannot identify image file' error message. I'm able to open .jpg
5
14995
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
3780
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. time / date Nice to have:
1
8784
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. After I'm done drawing on the bitmap, I convert it to 1bbp, then stick the propertyItems onto the bitmap. I've checked, and I can see each of the propertyItems I've put into the bitmap. I then save the file using the TIFF encoder and CCITT4...
0
8213
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8653
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8597
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8306
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7127
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5554
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4065
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.