简体   繁体   中英

Word VBA Macro to switch ribbon tab on open

I have a vba macro that runs from a ribbon button and opens a template. Modifications to the template are made using other buttons alongside the first. However, when the template opens from the "Template" tab as a new document, the "Home" tab is reselected. Is there code I can add to the end of the macro which would automatically switch it to the "Template" tab?

You can manipulate with keyboard combination Alt + Home + (2x) Esc

SendKeys "%(H)", False
SendKeys "{esc}", True
SendKeys "{esc}", True

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