Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Problem with insertable objects (rtf, Word) and the char spacing

Problem with insertable objects (rtf, Word) and the char spacing

Problem with insertable objects (rtf, Word) and the char spacing


I have had this problems for several years now, and even reported it once in the Crystal Reports forum (no replies) because I thought it was a CR problem.

I use the OLE container in our application so that the user can create/select several documents (using WordPad, MS Word, Open Office, or whatever)and then these documents are stored as binary in a db table (I'll call it here "Documents"). The user can then link a db stored document to a record in a different table (I'll call it here "Customers")

(The documents usually have text, logo images and different fonts and sizes)

When a report is printed for a record from the Customers table, a blob object (insertable object) on the Crystal Report rpt will dynamically display the correct Document for the selected customer.

There seems to be a problem with the spacing of characters in an ole inserted object.

In MS Office 2007, when I insert a document, all formating always shows correctly. But in the ole container, rtb, and even WordPad on Windows 2007, the character spacing looks often bad.

For example: If I create a Word 2007 document with only the text "Manymanymany" (Font Calibri 11), save it as docx (or doc, or rtf), and then insert as an object back into Word 2007, it shows correctly, but if I insert as an object it into WordPad, it shows "Man ymanym any" (Those are not chr(32) spaces, but instead, more narrow) or some of the letters are slightly crunched together.

If I create the text new and save to a second file, and the insert this, it may come out as "ManyM anymany"

Most of our customers do not have a big issue with this, but some newer ones really do.

I tried the rtb control from Krool's ActiveX CommonControls replacement (vbForums) but inserting the docx as an Object produces the same problem.

Is this already a known issue?

Any ideas what causes it, or how to correct it, or maybe there is a better way of doing this?

Thank you!

RE: Problem with insertable objects (rtf, Word) and the char spacing

I'm afraid that the OLE container control is rather old, and has a number of ... limitations. A frequent inability to maintain the fidelity of the display of a source document is one of those limitations. I am not aware of any fix.

RE: Problem with insertable objects (rtf, Word) and the char spacing

What about storing documents in PDF format? Obviously suggesting that you change your application is a big decision but PDF offers a one time conversion that does a very good job of cross platform presentation.

RE: Problem with insertable objects (rtf, Word) and the char spacing

>Krool's ActiveX CommonControls replacement

You have to understand that most of the Common Controls replacement efforts (e.g Krools, or the older CCRP) really do no such thing. What they do is replace (and hopefully improve) the OCX libraries used to warp the underlying Microsft components; the components themselves remain untouched.

So, if there is a bug in the underlying component, the 'replacement' control won't in the normal run of things fix that.

RE: Problem with insertable objects (rtf, Word) and the char spacing

Thank you for the responses.

(Our customers (small townships) generally use anything between Windows 2007 and upward, but mostly W2007).

Pdf seems not to work (or I am missing something). When a pdf is inserted directly in CR (or for that matter, WordPad 2007), (as opposed to using binary data stored in a db, which porduces the same results), the size shrinks to about 60% of the original. But it needs to be the same original size (sorry, forgot to mention that previously), as is the paper settings in MS Word (Scaling it in CR only increases the background white-space of the inserted pdf).

If the 2007 Doc/Docx is opened in MS Word 97 or 2000 and then saved back, everything is fine (however, saving it in 97-2003 format using Word 2007 doesn't help).

Just for the sake of mentioning it, if the 2007 Word doc is inserted into WordPad 2010, it also shows correctly.
So, assuming MS didn't correct the problem until latest 2010 (I do not know if W2008 works or not, but it doesn't matter).

Just so you know what this is for:
If the customer does not have, or want, to use their own pre-printed paper for their logos, mailing and other information arranged in a certain format, then we allow them to create documents of their choice (as long as it is capable of being an insertable embeded object and the work station can view the document), one for the header first page, header following pages. and one for the footer, or instead, just one for the complete size of the paper. to use these instead.

The user then selects from a vb form the objects which are to embedded in to the specific report sections. (The OLE container on the vb form is only used as a preview of the selections). Then the objects are saved into a database, which are pulled by CR during printing.

All has been working for almost 20 years, and still works, except since Word 2007 the spacing problems.

Can a doc be easily saved/"printed" programically as an image using vb6 or VB.Net?
<EDIT< I see something like this is possible if MS Word is installed Link.

RE: Problem with insertable objects (rtf, Word) and the char spacing


Was going to suggest we require customers to have only one workstation with MS Word if the they want to make roll their own, and then using our program just create the bmp on that machine and save the binary, and for for the few who do not have MS Office 2007+ at all, offer a send-in-return conversion service.

I guess I set the hopes to high...

\Microsoft Office\Office12\MSWORD.OLB (14.09.2011)

produces the same problem.

Oh well.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close