code to see if template has custom buttons or menus

L

Lina

Hi!
I need to convert many dot files to dotm or dotx, some of them has custom
buttons. Is there a way to see with code if a template has custom buttons
added? Something like

If mytemp has custom button then
debug.print mytemp.name
end if
so that I can go thru those fiels and fix the buttons

Thanks
 
D

Doug Robbins - Word MVP

Run this on a blank document to get the base number and then on documents
created from your templates. Any increase in the number will indicate that
they contain customizations

CustomizationContext = ActiveDocument.AttachedTemplate
MsgBox Application.CommandBars.Count


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
L

Lina

But what if they have used the ui to make the button and just draged it to a
built in commandbar? Then the number of commandbars will still be the same.
Do you know if I can see if a button is built in or a custom button? Maybe I
will have to loop thru the commandbars and count the buttons...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top