PDA

View Full Version : Solved: resize rpt section based on image



eed
11-14-2005, 11:02 AM
Hi, all,

I'm working on a database to enter data as document sections (i.e., 1.0, 1.1, 2.0, etc.). The user enters each section number, title, and body text. They also need the ability to insert an image, either before or after the body text.

So, some records will have images and some will not, and images may vary drastically in size. I'm trying to determine the best way to build the report to accomodate the unpredictable size of the images, because I don't want huge gaps of space in records that have no images.

Currently I have the fields PictureBefore and PictureAfter in subreports; the subreports are made as small as possible and their CanGrow and CanShrink properties are set to Yes. If I could determine the height of the images... then resize the Detail sections of the subreports to those heights during OnFormat for the Detail section of the main report ... Does this make sense? Can this be done? Would it achieve what I'm looking for? Or could anyone suggest a better way to manage these unpredictable images? I've attached a simple sample file to maybe help illustrate the problem.

Thanks in advance for any help; this has really been puzzling me! http://vbaexpress.com/forum/images/smilies/thinking.gif
~ eed

eed
11-17-2005, 03:30 PM
Okay, let me ask a different question that would solve the same problem for me...

If the user enters the filepath of an image file into a text field, and I'm building a report in Word using automation, could I use the filepath in the record to insert the image itself at a specific bookmark in my Word template? What code would be required to tell Word to insert the image that resides at the specified filepath?

Thank you in advance for any assistance! http://vbaexpress.com/forum/images/smilies/notworthy.gif

~ eed

geekgirlau
11-18-2005, 03:17 AM
A quick way to do this is to record the steps in Word of inserting a graphic image (Insert | Picture | From File | <pathname to your image>). It may then need some further manipulation to control the text wrap properties in Word.

eed
11-21-2005, 09:33 AM
A quick way to do this is to record the steps in Word of inserting a graphic image (Insert | Picture | From File | <pathname to your image>). It may then need some further manipulation to control the text wrap properties in Word.
Thanks, geekgirlau. I'll experiment with recording the image insertion process; this should suit my needs.

~ eed