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,
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,