你建立宏时在保存时应该选择保存到normal模板

解决方案 »

  1.   

    做个   新建WORD。exe 
    拷贝摸版
    然后替换快捷方式
    ================================================================ok?
      

  2.   

    也可以替换
    C:\WINDOWS\Application Data\Microsoft\Templates\Normal.dot
    ================================================================ok?
      

  3.   

    你先自己做個文件做模板,在這個文件里建立宏.
    然後在在VBA程序中打開這個有宏的模板文件,我想就可以調用宏了.
      

  4.   

    还可以直接放入
    C:\WINDOWS\Application Data\Microsoft\Templates\my.dot这样你就可以有多个摸板而不改变原来的使用方式还有右键采单里 查注册表添加一项
    ================================================================ok?
      

  5.   

    Sub WordSysLoad()
        Dim i As Integer
        Dim Tmp As String
        
        On Error Resume Next    For i = 1 To CommandBars.Count
            Tmp = "Custom Popup " & Trim(Str(i))
            'b = "Custom Popup " & i
            'If a = b Then MsgBox "d"
            'CommandBars(Tmp).Visible = True
            CommandBars(Tmp).Delete
        Next
        'MsgBox Application.Keyboard
        'Application.Keyboard (2052)
        
        CommandBars("¹«ÎÄ´¦Àí").Delete
        CommandBars("¹«ÎÄ´¦Àí").Delete
        CommandBars.Add(Name:="¹«ÎÄ´¦Àí").Visible = True
        
        CommandBars("¹«ÎÄ´¦Àí").Visible = True
        CommandBars("¹«ÎÄ´¦Àí").Controls.Add Type:=msoControlPopup, Before:=1
        CommandBars("¹«ÎÄ´¦Àí").Controls.Add Type:=msoControlPopup, Before:=2
        CommandBars("¹«ÎÄ´¦Àí").Controls.Add Type:=msoControlPopup, Before:=3
        CommandBars("¹«ÎÄ´¦Àí").Controls.Add Type:=msoControlPopup, Before:=4
            CommandBars("¹«ÎÄ´¦Àí").Controls.Item(1).Caption = "²åÈë"
            CommandBars("¹«ÎÄ´¦Àí").Controls.Item(2).Caption = "ɾ³ý"
            CommandBars("¹«ÎÄ´¦Àí").Controls.Item(3).Caption = "¿ò¼Ü"
            CommandBars("¹«ÎÄ´¦Àí").Controls.Item(4).Caption = "PDFÖÆ×÷"
        
        'CommandBars("Custom Popup 1").Delete
        CommandBars("Custom Popup 1").Controls.Add Type:=msoControlPopup, _
            Before:=1
        CommandBars("Custom Popup 1").Controls.Add Type:=msoControlPopup, _
            Before:=2
        CommandBars("Custom Popup 1").Controls.Add Type:=msoControlPopup, _
            Before:=3
        CommandBars("Custom Popup 1").Controls.Add Type:=msoControlButton, _
            Before:=4
            CommandBars("Custom Popup 1").Controls.Item(1).Caption = "¹«Îıê¼Ç"
            CommandBars("Custom Popup 1").Controls.Item(2).Caption = "¹«ÎÄ°æ¼Ç"
            CommandBars("Custom Popup 1").Controls.Item(3).Caption = "¹«ÎÄÓ¡ÕÂ"
            CommandBars("Custom Popup 1").Controls.Item(4).Caption = "³­Ë͵¥Î»"
            
            
        CommandBars("Custom Popup 2").Controls.Add Type:=msoControlButton, _
            Before:=1
        CommandBars("Custom Popup 2").Controls.Add Type:=msoControlButton, _
            Before:=2
        CommandBars("Custom Popup 2").Controls.Add Type:=msoControlButton, _
            Before:=3
        CommandBars("Custom Popup 2").Controls.Add Type:=msoControlButton, _
            Before:=4
            CommandBars("Custom Popup 2").Controls.Item(1).Caption = "¹«ÎıêÌâ"
            CommandBars("Custom Popup 2").Controls.Item(2).Caption = "¹«ÎÄ°æ¼Ç"
            CommandBars("Custom Popup 2").Controls.Item(3).Caption = "¹«ÎÄÓ¡ÕÂ"
            CommandBars("Custom Popup 2").Controls.Item(4).Caption = "ɾ³ýÈ«²¿"
            
        CommandBars("Custom Popup 3").Controls.Add Type:=msoControlButton, _
            Before:=1
        CommandBars("Custom Popup 3").Controls.Add Type:=msoControlButton, _
            Before:=2
        CommandBars("Custom Popup 3").Controls.Add Type:=msoControlButton, _
            Before:=3
            CommandBars("Custom Popup 3").Controls.Item(1).Caption = "XXXÎļþ"
            CommandBars("Custom Popup 3").Controls.Item(2).Caption = "XXXÎļþ"
            CommandBars("Custom Popup 3").Controls.Item(3).Caption = "XXXÎļþ"
          
          
            
        CommandBars("Custom Popup 4").Controls.Add Type:=msoControlButton, _
            Before:=1
        CommandBars("Custom Popup 4").Controls.Add Type:=msoControlButton, _
            Before:=2
        CommandBars("Custom Popup 4").Controls.Add Type:=msoControlButton, _
            Before:=3
        CommandBars("Custom Popup 4").Controls.Add Type:=msoControlButton, _
            Before:=4
            CommandBars("Custom Popup 4").Controls.Item(1).Caption = "´òÓ¡"
            CommandBars("Custom Popup 4").Controls.Item(2).Caption = "Ñ¡Ïî"
            CommandBars("Custom Popup 4").Controls.Item(3).Caption = "°ïÖú"
            CommandBars("Custom Popup 4").Controls.Item(4).Caption = "About"
            CommandBars("Custom Popup 4").Controls.Item(1).OnAction = "newmacros.pdf"
            CommandBars("Custom Popup 4").Controls.Item(2).OnAction = "newmacros.edit"
            CommandBars("Custom Popup 4").Controls.Item(3).OnAction = "newmacros.edit"
            CommandBars("Custom Popup 4").Controls.Item(4).OnAction = "newmacros.edit"
            
        CommandBars("Custom Popup 5").Controls.Add Type:=msoControlButton, _
            Before:=1
        CommandBars("Custom Popup 6").Controls.Add Type:=msoControlButton, _
            Before:=1
        CommandBars("Custom Popup 7").Controls.Add Type:=msoControlButton, _
            Before:=1
            CommandBars("Custom Popup 5").Controls.Item(1).Caption = "±íÍ·1"
    End Sub以上是完整的代码!用在2000里头,问题1,为什么有时候建立目录正常,有时候建立不正常??Tmp = "Custom Popup " & Trim(Str(i))作用是清除 Custom Popup 1~100用的,可是有时候无法清除,导致了建立菜单任务失败,但是删除在运行几次就能成功,就是说目录下内容都能正确显示!!!奇怪呀!还有先多谢楼上各位老大,问题看来被误会,以上宏目前都写在一个摸板中的,希望用vb把他调用到word系统里的那个摸板,如果手工添加就没有意义了,就是希望做成全自动的,还有,在win2000里头Normal.dot是随用户而改变目录的,不是绝对的!头大呀!!不管那么多了,上面这个代码都很头疼,如果能解决我新建立个帖子给50分先,摆脱了!
      

  6.   

    Tmp="Custom Popup 1"
    CommandBars(Tmp).Delete
    msgbox CommandBars(Tmp).Controls.Item(1).Caption 
    这样还能显示里头的数值¥#·%……%¥
    根本没有清除呀,但是如果一旦清除成功那又没有问题了!