简体   繁体   中英

Link Content Control to Legacy Form Field in MSFT Word (VBA)

I'm sure this question has an easy answer, but I have a short timeline and need to get it resolved ASAP.

I'd like to have a content control drop down that when the user makes a selection, will update a legacy text box formField with the selected value.

I have no trouble selecting form fields and setting them using VBA code:

ActiveDocument.FormFields("MyFieldName").Result

But I'm having trouble selecting the value from the content control, and also figuring out how to execute the macro "onExit" like I can with legacy fields / drop downs.

Any suggestions?

Google "vba content control events".

For example, see the last post by Greg Maxey at how-to-catch-custom-control-events-with-vba-macro and towards the bottom of his page http://gregmaxey.mvps.org/word_tip_pages/content_controls.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM