Please Help!

VickyC

Registered User.
Local time
Today, 12:23
Joined
Aug 31, 2005
Messages
18
Hello,

I have created a bill template, in word using VB6.

When opening the template a form appears asking the user to fill out general information and to select how many costs and how many disbursements need to be added to the bill.

They then select create bill. They then get another form where they fill out the text for the cost, the amount and whether it is VAT chargeable.

They also do the same for the disbs repeating this until all costs and disbursements are done.

When selecting finish this information appears in the bill in the correct location. The problem I have I have designed it so the that last row resizes itself to meet another table which holds the totals.

the code for this is as follows:

'---------------- Resize the last row -----------------------------
VntStartTableHeight = 0
For counter2 = 1 To (4 + varDisb)
Set VntEachRowHeight = ActiveDocument.Tables(1).Rows(counter2).Range
VntStartTableHeight = VntStartTableHeight + Rangeheight(VntEachRowHeight)
Next counter2
' VntStartTableHeight = Height of the table
ActiveDocument.Tables(1).Rows.Last.HeightRule = wdRowHeightExactly
' Make the last row (last row height plus 124 millimetres less table height)
ActiveDocument.Tables(1).Rows.Last.HeightRule = (MillimetersToPoints(6) + MillimetersToPoints(124)) - VntStartTableHeight
ActiveWindow.View.Zoom.PageFit = wdPageFitBestFit

I am wanting the users to be able to amend this should they need to add additional text but I do not want the row size to increase. I am also wanting an error to appear should they be running out of characters.

I have searched and searched for the correct syntax, but seem to be hitting a brick wall... Can anyone advise if this is possible and how this could be done... ??? I really appreciate any help that could be given. Hope I make sense.

Many thanks,
 
Simple Software Solutions

Vicky

If I am right what you want to do is purely cosmetic and you want to make them look the same irrespective of how many lines are on the template?

If the total height could accommodate say 12 rows of info but only 3 are populated then you want the third row to be the equivelent height of 10 rows, so that the combined depth of the orders is maintained.

What I suggest is that you paint the rows as normal without any height parameters. Then state that the last line height = first lines height times then total number of rows -1. This will ensure that the last row will always be the correct height depending on the number of preceeding rows.

David
 

Users who are viewing this thread

Back
Top Bottom