Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Arthi Arthi is offline
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Form Fields Macro on exit problem Bruce P. Microsoft Word Help 1 April 19th 07 06:02 PM
Copy a macro into many templates Rich W. Microsoft Word Help 1 March 8th 06 11:03 PM
How do I create an on-exit macro? KamiBell Microsoft Word Help 1 September 29th 05 09:24 PM
Run macro on Exit problem Leonard Microsoft Word Help 3 August 24th 05 10:29 PM
Macro to Print and Exit after Merge Karen Hart Mailmerge 2 February 11th 05 09:10 PM


All times are GMT +1. The time now is 03:36 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"