I am building a pretty substantial (protected) form with Word in Office XP.
Many of the text box form fields will contain numerical values. I need to be able to check for a valid number with IsNumber() and also to check that a value is present. If not, an error message is to be issued to the user.
In the text box properties, I specify an exit macro to do the checking. I need to know the name of the textbox (bookmark name) as well as the value/result contained in it.
I know it sounds crazy, but I have yet to find a consistent way to do this for the selected textbox in VBA. There do not seem to be any objects I can use to get this info. Bookmarks are alphabetized & return an erroneous name -- not the one I'm currently in. Form field objects work great for checkboxes, but not textboxes --- i'd have to hardcode the box name. I'm trying to keep it general, but I'm unable to even determine the formfield index. Seems like this would be so basic as to be trivial, but Word just won't give me this info.
Anyone have any suggestions on how to solve this dilemma??
Many thanks in advance,
Bob
Many of the text box form fields will contain numerical values. I need to be able to check for a valid number with IsNumber() and also to check that a value is present. If not, an error message is to be issued to the user.
In the text box properties, I specify an exit macro to do the checking. I need to know the name of the textbox (bookmark name) as well as the value/result contained in it.
I know it sounds crazy, but I have yet to find a consistent way to do this for the selected textbox in VBA. There do not seem to be any objects I can use to get this info. Bookmarks are alphabetized & return an erroneous name -- not the one I'm currently in. Form field objects work great for checkboxes, but not textboxes --- i'd have to hardcode the box name. I'm trying to keep it general, but I'm unable to even determine the formfield index. Seems like this would be so basic as to be trivial, but Word just won't give me this info.
Anyone have any suggestions on how to solve this dilemma??
Many thanks in advance,
Bob