简体   繁体   中英

Calling macros on creating new word document from template

I need to call specific macros when creating new file from word template (.dot). I tried events such as "NewDocument", but it doesn't help. Is there any other ways to do this?

You can use AutoNew

sub AutoNew()
    <put your macro calls here>
end sub

More information can be obtained here

https://docs.microsoft.com/en-us/office/vba/word/concepts/customizing-word/auto-macros

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