From: Lina on
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
From: Doug Robbins - Word MVP on
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

"Lina" <Lina(a)discussions.microsoft.com> wrote in message
news:F0BEA578-E96F-458B-8F53-CC5959E998B7(a)microsoft.com...
> 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

From: Lina on
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...


"Doug Robbins - Word MVP" wrote:

> 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
>
> "Lina" <Lina(a)discussions.microsoft.com> wrote in message
> news:F0BEA578-E96F-458B-8F53-CC5959E998B7(a)microsoft.com...
> > 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
>