How can I make a MANDATORY form field in Microsoft 2010 with VBA? -


i'm new vba i'm learning quick. need making mandatory form fields in microsoft word. user should not able save or save & send document without filling in of mandatory form fields.

i found below code online:

sub mustfillin()     if activedocument.formfields("text1").result = ""                     sinfld = inputbox("this field must filled in, fill in below.")         loop while sinfld = ""         activedocument.formfields("text1").result = sinfld     end if end sub 

but not know how rename field in microsoft word. example, first form field, should called "firstname" instead of "text 1". how name form field in microsoft word 2010?

thanks in advance,

mark

you can use control's tag property this. see here. word 2010, newer versions should work same.


Comments

Popular posts from this blog

php - Admin SDK -- get information about the group -

dns - How To Use Custom Nameserver On Free Cloudflare? -

Python Error - TypeError: input expected at most 1 arguments, got 3 -