Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Exit Macro | Dot Templates
Hi all,
I have a Dot template with some form fileds and table's in the template, both Form Fields and Tables are all in diffrent sections. The form filed sections is protected but the tables sections is unprotected. The formfields are mandatory and i have assinged an ExitMacro to each form filed. Now the Exit macro are not getting executed when the focus(Using Mouse) is taken away from a form field( in protected section ) to a table row in the unprotected section. else the exit macro are executed and are working fine when the focus is taken off from one form fiels to another using mouse.(in same Protected section). I have attached the Macro Below Sub ExitMacroforTitle() With ActiveDocument If (.FormFields("Title").Result = "" Or LenTrim.FormFields"Title").Result)) = 0) Then MsgBox ("Title is Mandatory") .FormFields("Title").Result = "Please enter Title here" End If End With End Sub Is there any method by which the macro can be executed and i get the msgbox if no data is entered in the formfiled. Any help will be of great use.Thanks In Advance Arthi |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Exit Macro | Dot Templates
There's a simpler way of validating the fields at
http://www.gmayor.com/formfieldmacros.htm however the exit macros are tripped by tabbing out of the field, whichever method you use. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Arthi wrote: Hi all, I have a Dot template with some form fileds and table's in the template, both Form Fields and Tables are all in diffrent sections. The form filed sections is protected but the tables sections is unprotected. The formfields are mandatory and i have assinged an ExitMacro to each form filed. Now the Exit macro are not getting executed when the focus(Using Mouse) is taken away from a form field( in protected section ) to a table row in the unprotected section. else the exit macro are executed and are working fine when the focus is taken off from one form fiels to another using mouse.(in same Protected section). I have attached the Macro Below Sub ExitMacroforTitle() With ActiveDocument If (.FormFields("Title").Result = "" Or LenTrim.FormFields"Title").Result)) = 0) Then MsgBox ("Title is Mandatory") .FormFields("Title").Result = "Please enter Title here" End If End With End Sub Is there any method by which the macro can be executed and i get the msgbox if no data is entered in the formfiled. Any help will be of great use.Thanks In Advance Arthi |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Form Fields Macro on exit problem | Microsoft Word Help | |||
Copy a macro into many templates | Microsoft Word Help | |||
How do I create an on-exit macro? | Microsoft Word Help | |||
Run macro on Exit problem | Microsoft Word Help | |||
Macro to Print and Exit after Merge | Mailmerge |