你建立宏时在保存时应该选择保存到normal模板
解决方案 »
- 出错提示 Adodc1 对像关闭时,不允许操作
- 如何实现:在VB中点击一个按钮,则调出Windows自带的计算器?
- 如何把combox变成平面的?
- 散分!如何改变位图的大小(分不够可再加,在线等待)
- 小女子来求救!~~VB+SQL
- 超级简单 哪位告诉我?窗体右上角的关闭事件的控制代码
- vb6 如何移动外部程序的无标题栏窗口?
- forms2.0中的控件
- 如何使用MSHFlexGrid控件显示数据库表中内容(使用ADO引用),谢谢!
- VB是否自带ActiveBar控件?
- 特大喜讯!!!!google又回来了,让其他搜索滚蛋!!!
- 怎样替换UserControl的DragDrop事件,即把UserControl中的一个标准控件的DragDrop事件传出来代替默认的用户控件事件。
拷贝摸版
然后替换快捷方式
================================================================ok?
C:\WINDOWS\Application Data\Microsoft\Templates\Normal.dot
================================================================ok?
然後在在VBA程序中打開這個有宏的模板文件,我想就可以調用宏了.
C:\WINDOWS\Application Data\Microsoft\Templates\my.dot这样你就可以有多个摸板而不改变原来的使用方式还有右键采单里 查注册表添加一项
================================================================ok?
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分先,摆脱了!
CommandBars(Tmp).Delete
msgbox CommandBars(Tmp).Controls.Item(1).Caption
这样还能显示里头的数值¥#·%……%¥
根本没有清除呀,但是如果一旦清除成功那又没有问题了!