View Single Post
 
Old 11-13-2012, 12:18 PM
Andrew H Andrew H is offline Windows 7 32bit Office 2010 32bit
Advanced Beginner
 
Join Date: Nov 2012
Location: Montreal, Quebec
Posts: 51
Andrew H is on a distinguished road
Default Drop-Downs: Run Macro on Exit

It appears that a macro that I have set up to run "on exit" from a drop-down list is not executing. At present, I am simply interested in learning how to get any macro to run on exit. Here is the macro that I have set up to run on exit:

Sub PrintTextonSelection()
ActiveDocument.Unprotect
Dim MyText As String
MyText = "I made a selection"
Selection.TypeText (MyText)
End Sub

To test, I first protected the file (in order to allow use of the drop-down) and then made a selection. Result: the "I made a selection" text was not inserted nor did the document transition to an unprotected state.

I am a complete novice re VBA and macros. Any suggestions welcomed.
Reply With Quote