Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. problems with removing menu added to Word97

problems with removing menu added to Word97

Scheduled Pinned Locked Moved Visual Basic
helpcareer
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi I'm creating new menu and toolbar in AutoExec sub, and removing it in AutoExit. When AutoExit executes I can see that menu and toolbar dissapear, but when I delete .dot from autostart directory and launch Word they are back. But when I manually execute AutoExit then menu and toolbar dissapear forever (strange, isn't it). Here are my subs: Sub AutoExec() Dim PKICommandBar As CommandBar Dim PKIMenu As CommandBarPopup Dim ETSIMenu As CommandBarPopup Dim lTest As Long 'menu Set PKIMenu = Application.CommandBars("Menu Bar").FindControl _ (Type:=msoControlPopup, Tag:=sMenuName) On Error Resume Next lTest = PKIMenu.Height If (lTest = 0) Then Set PKIMenu = Application.CommandBars("Menu Bar"). _ Controls.Add(Type:=msoControlPopup) PKIMenu.Caption = sMenuName PKIMenu.Tag = sMenuName On Error Resume Next PKIMenu.Controls(sETSIMenuName).Delete Set ETSIMenu = PKIMenu.Controls.Add(Type:=msoControlPopup) ETSIMenu.Caption = sETSIMenuName With ETSIMenu.Controls.Add(msoControlButton) .OnAction = "SignDocument" .Caption = "Podpisz dokument" End With With ETSIMenu.Controls.Add(msoControlButton) .OnAction = "Settings" .Caption = "Ustawienia" End With 'toolbar On Error Resume Next Application.CommandBars(sETSIMenuName).Delete lTest = 0 Set PKICommandBar = Application.CommandBars.Add PKICommandBar.Name = sETSIMenuName With PKICommandBar.Controls.Add(msoControlButton) .Style = msoButtonIconAndCaption .FaceId = 22 .TooltipText = "Podpisz dokument" .OnAction = "SignDocument" End With With PKICommandBar.Controls.Add(msoControlButton) .Style = msoButtonIconAndCaption .FaceId = 22 .TooltipText = "Ustawienia" .OnAction = "Settings" End With PKICommandBar.Position = msoBarTop PKICommandBar.Visible = True End Sub Sub AutoExit() On Error Resume Next Application.CommandBars(sETSIMenuName).Delete On Error Resume Next Application.CommandBars("Menu Bar").Controls(sMenuName).Delete MsgBox ("exit")'that's why I can see that menu and toolbar dissapear when I close Word End Sub Thanks for any help

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups