I am using VBA with Word 2003. I want to dynamically change the ColumnWidths property of a ListBox control (on a UserForm) based on the length of the text entered by the user. Here's why:
The width of my ListBox is quite large: 450 pts. I really can't make it much larger than that due to design constraints on the UserForm. The width is large enough to accomodate most, but not all, of the values that a typical user might enter.
I want to adjust the ColumnWidths property only when needed in order to show the horizontal scroll bar when an entry is too large for the control. (Setting the combined ColumnWidths > Width displays the horizontal scroll bar.)
So here's my question: how do I calculate the width (in points, picas, or whatever) of the text entered by the user?
The width of my ListBox is quite large: 450 pts. I really can't make it much larger than that due to design constraints on the UserForm. The width is large enough to accomodate most, but not all, of the values that a typical user might enter.
I want to adjust the ColumnWidths property only when needed in order to show the horizontal scroll bar when an entry is too large for the control. (Setting the combined ColumnWidths > Width displays the horizontal scroll bar.)
So here's my question: how do I calculate the width (in points, picas, or whatever) of the text entered by the user?