How to get an word event for a dropdown list in the menu

Hi,
I have a dot file. I have added a custom menu and to the menu I have added a dropdown with:
ActiveDocument.CommandBars("Checkit-med").Controls.Add Type:= msoControlDropdown
The Dropdown Control I have named "ddTM" and in the ThisDocument_Open event I read all Bookmark names into this Dropdown.
Everything works fine till now.

Problem: My goal is, that if the user chooses a Bookmark name in the DropdownControl the Bookmark with the same name as the dropdown text should be selected. The user chooses with the dropdown Control in the menu per example "Bookmark1" an event is triggered and the Bookmark "bookmark1" is selected.

But how can I trigger an event to his dropdown control in the menu?
Or should I use something like Selection.InlineShapes.AddOLEControl ClassType:="Forms.ComboBox.1"?
Then I have an event, but I do not know how to get such an OLEControl into the menu.

Please help.  Thanks for any afford.
rolandkg1001Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

irudykCommented:
Try this...
In your ThisDocument_Open routine add the following to the end (or after where you finish adding the bookmark names to the droplist)
    ActiveDocument.CommandBars("Checkit-med").Controls("dtMM").OnAction = "SelectBookmark"
Then add the following routine into your VBA code
 

Sub SelectBookmark()
    ActiveDocument.Bookmarks(ActiveDocument.CommandBars("Checkit-med").Controls("dtMM").List(ActiveDocument.CommandBars("Checkit-med").Controls("dtMM").ListIndex)).Select
End Sub

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rolandkg1001Author Commented:
Thanks, you helped me a lot!!!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.