How To Check If Text Overflows In Text Paragraph? 追蹤

0

Hi,

I have a textbox paragraph type data-source using excel. How can I display a warning during print time when the text overflows outside the border?

I am thinking of calculating the height of the textbox during print and it if it is over a certain height display warning message, can someone please help me with the code to do this. 

 

Thank you 

1 意見

0
Avatar
Fernando Ramos Miracle
版主
評論操作 永久連結

Hello Sai,

 

In order to evaluate the height of an object, you'll need to use a document level VB Script (Automation edition or higher is required) accessible from the "File>BarTender Document Options..." item under the "VB Script" tab.

 

From there you could add a code similar to the below to the "OnNewRecord" event, so it runs for each one of your records.

 

If Format.Objects(«object name or index»).Height Then
    Format.CancelPrinting("Data overflows text object")
End If

 

The Format.CancelPrinting() function will prompt a message asking you if you wish to continue or cancel the print job.

 

Regards.

登入寫評論。