Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Disable word's save toolbar button and file menu button
Message
De
21/03/2001 12:56:47
 
 
À
21/03/2001 12:42:13
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00485474
Message ID:
00487297
Vues:
17
To Neil:

Change the file name to something more to your liking. The file lists
ID, Caption, Depth, Type.

To John:

I use these IDs to disable individuals tools and menu options. If you disable the unwanted options in the AutoOpen of a template, it reduces the number of errors caused by the user doing something there are not supposed to for all documents created from this template.

Daniel
Sub OutputControlsID()

' ====================================
'  Extract the Caption and ID of all
'  controls contained on all toolbars
'  (including the menu).
'
'  This procedure is included to help
'  maintenance of the other macros;
'  it is not used in the Tax Rep.
'  Narrative process.
' ====================================
Close #1
Open "c:\temp\toolbars.txt" For Output As #1

For Each loToolBar In CommandBars
   Write #1, 0, loToolBar.Name, 1
   For Each loControl In loToolBar.Controls
      Write #1, loControl.ID, loControl.Caption, 2, loControl.Type
      If loControl.Type = msoControlPopup Then
         For Each loCtrl3 In loControl.Controls
            Write #1, loCtrl3.ID, loCtrl3.Caption, 3, loCtrl3.Type
            If loCtrl3.Type = msoControlPopup Then
               For Each loCtrl4 In loCtrl3.Controls
                  Write #1, loCtrl4.ID, loCtrl4.Caption, 4, loCtrl4.Type
               Next
            End If
         Next
      End If
   Next
Next

Close #1
End Sub
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform