Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2006

Tip: Looking for answers? Try searching our database.

Eneable or unEneable Events in the Forms created with VBA for MS-Word

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MorenD - 18 Nov 2006 21:22 GMT
     I use to include the sentence "Application.EneableEvent = 'False' or
'True'"  in VBA applications developed in the MS-Excel platform.  It works
very well in association with actions performed in the spreadsheets or the
workbook, but not when the action is performed in Userforms.  
     Now I am develop a short utility in VBA using the MS-Word platform and
I need to know if it is posible to un-eneable the events associated to
elements of a Userform created with VBA in MS-Word?
Doug Robbins - Word MVP - 18 Nov 2006 22:37 GMT
You can certainly enable or disable controls on a userform using the
.Enabled attribute of the control

[controlname].Enabled = False

will disable the control named controlname.  Setting the attribute to True
will enable the control.

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

>      I use to include the sentence "Application.EneableEvent = 'False' or
> 'True'"  in VBA applications developed in the MS-Excel platform.  It works
[quoted text clipped - 4 lines]
> I need to know if it is posible to un-eneable the events associated to
> elements of a Userform created with VBA in MS-Word?
Shauna Kelly - 18 Nov 2006 22:55 GMT
Hi MorenD

Word (sadly) has no equivalent of Excel's Application.EnableEvents method.
And no VBA has an .EnableEvents that works in user forms.

The workaround is generally to create a global or module-wide variable
called, say, bEventsEnabled as a boolean. Wrap your code like this:

If bEventsEnabled then
   'your code here
Endif

and set bEventsEnabled to False when you don't want the event code to run.

Hope this helps.

Shauna Kelly.  Microsoft MVP.
http://www.shaunakelly.com/word

>      I use to include the sentence "Application.EneableEvent = 'False' or
> 'True'"  in VBA applications developed in the MS-Excel platform.  It works
[quoted text clipped - 4 lines]
> I need to know if it is posible to un-eneable the events associated to
> elements of a Userform created with VBA in MS-Word?
Jezebel - 19 Nov 2006 02:19 GMT
Another approach is put the from controls inside a frame: then you can
enable/disable them collectively by enabling/disabling the frame.

> Hi MorenD
>
[quoted text clipped - 25 lines]
>> I need to know if it is posible to un-eneable the events associated to
>> elements of a Userform created with VBA in MS-Word?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.