1

Wd Clean

Embed Size (px)

DESCRIPTION

Wd Clean

Citation preview

Attribute VB_Name = "WDClean"Option Explicit'Version 2.01Private Const NameOfControl1 = "The Encyclopedia of World History"Private Const NameOfControl2 = "American Heritage Dictionary"Dim OurControls(2) As String

Sub AutoExec() On Error Resume Next Dim f Dim n As Integer Dim removed Dim NewControl As CommandBarButton OurControls(1) = NameOfControl1 OurControls(2) = NameOfControl2 removed = False For Each f In CommandBars For n = 1 To 2 Set NewControl = Nothing Set NewControl = f.Controls(OurControls(n)) If Not (NewControl Is Nothing) Then NewControl.Delete removed = True End If Next Next If removed Then NormalTemplate.Save End If Err.ClearEnd Sub

Attribute VB_Name = "ThisDocument"Attribute VB_Base = "1Normal.ThisDocument"Attribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = TrueAttribute VB_TemplateDerived = TrueAttribute VB_Customizable = True