Solved

How to print variable length Word document (less than 1 page) in an Access Report

Posted on 2009-06-29
10
350 Views
Last Modified: 2013-11-28
I have a table that has 2 variable-length objects. The objects need to contain text that has paragraph and font formatting instructions (e.g., paragraph breaks, imbedded bolding, colors on phrases). Most of the time the text objects are less than one page long, but are variable in length, and sometimes exceed one page. I currently have the objects as imbedded OLE Objects containing Word document "snippets". The problem with this approach is that you can't size the OLE Object on a report to grow or shrink based upon the number of lines in each record's text. Is there a way to resize a Word OLE Object on a report? Or, is there a way to save the "snippets" in a Memo field and still keep the paragraph/font formatting information? BTW: I'm not needing to edit the information in the "snippets", just store them and display them on a form and in a report.
0
Comment
Question by:MOinReno
  • 4
  • 4
10 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 24742809
I think you are out of luck with this.

As far as I know you can only display one page in an OLE object.To display two pages you would need two controls showing different pages.

Leave the Q open for a while and see if anyone else knows any different, but don't hold your breath!

Are you able to consider printing the Word doc as a completely separate document to be attached to the Access report?
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 24743472
MOinReno,

I'm with Pete on this.

Questions:
1. What is the problem if the OLE object is more than 1 page?
2. Please clarify what you mean by a "Snippet"
A snippet of the raw text?
If so then you will have to then create a system to open eachword Doc and insert the first x characters into every memo filed. (again, a lot of work and requireing VBA Code)
3. If this is Access 2007, it may be possible to create a Pop-up Report.
4. Is there any way to limit the data in the Word Doc, so that it will fit onto one page?
5. It *always* helps if you exaplain *exactly* what it is you are trying to accomplish.
Sometimes there is a different/better approach.

;-)

JeffCoachman
0
 

Author Comment

by:MOinReno
ID: 24745133
By "snippet" I mean one to several paragraphs of formatted text. The "snippet" content is different for each item listed in a table. Sometimes the text is 3-4 lines, other times it is 6-12, others still it is 50-60 lines - it just depends on how much verbiage is needed to describe the given item listed in each row of the table. I would say that in only 10-15% of the time, the text required to describe the topic takes more than a single page.

My primary issue is working with the variable length of the text - it isn't a workable solution to size the OLE object on the report to work with the largest possible size as that requires a minimum of 3 pages for each item and leaves large blank gaps when there isn't much verbiage for a particular item. Most of the time, the information in the non-OLE table elements + the height of the content in the 2 OLE elements will easily fit on a single page.

The Word "snippets" for each particular item are already pasted into 2 OLE elements in the table, so assembling the data + snippets into the report isn't difficult.

The only reason that I am using Word "snippets" is to allow the user to utilize paragraphing (CRLFs) and font formatting (bolding, underlining, font coloring) of individual words or phrases. I know that Memo fields can handle CRLF's, but it can't handle the font formatting. Many years ago (maybe 1993-95), I ran across a company that sold a library of Access addins that allowed someone to imbed (and even in-line manipulate) rich text inside Memo fields - meaning you could apply underlining, bolding, and font coloring - but a cursory google last week didn't yield any such addin today, hence why I'm trying to work with the imbedded OLE objects. If there is a way to utilize more robust rich text inside Memo fields, I would prefer to do that.

If I have to continue working with imbedded Word OLE "snippets", I know how to handle the multi-page aspect. I just don't know how to shrink or grow the height of an OLE object that doesn't require an entire page.
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 24745943
The only thing I can think of is to set the Size of the OLE control to the size of one page.
Then set the Size mode property of the control to Zoom.

The Zoom setting will size the contents of the control to always to fit the available size.
It also keeps the aspect ratio of the original object.

JeffCoachman
0
 

Author Comment

by:MOinReno
ID: 24751528
boaq2000, I tried your solution, but it didn't resize the object any smaller than the specified height of the OLE object in the report.

Anyone know of an add-in that allows imbedded font formatting in a Memo field?
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 24752496
Then if my Solution did not solve your issues then you should not have accepted it.

By accepting a post you are saying that it is the "Solution" and hence, the question is "Closed".

I have requested that this Q be re-opened.
0
 

Author Comment

by:MOinReno
ID: 24759096
I personally consider the question closed. While the 2 responses didn't provide me with a solution using the imbedded Word document method that I described. Peter57r confirmed my understanding that no solution using this method (other than splitting mult-page "snippets" into separate OLE fields - a task that would be very cumbersome for my usrers) was going to solve one of my problems. Boaq2000 provided a potential workaround for sub one-page "snippets" using the method described - it didn't work. But their responses did finalize my decision to seek a different method to accomplish my task, something that I was able to do by spending more time querying experts-echange's excellent knowlegebase.

I'm not sure what EE wants to do with the question, but EE did provide me with a solution and I am satisfied with how it is working.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 24759421
OK,

Then I suggest that you now accept Pete's post.

;-)

Jeff
0
 

Author Closing Comment

by:MOinReno
ID: 31598223
See final post
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question