守柔版主:以下这段代码是你写的?它只是在工具栏添加一个按钮,我想问的是,这段代码如何修改才能将工具栏的图标改为某个图片.比如:将存盘的磁盘图标,改为自已的图片.
先谢谢了!
Option Explicit Sub NewFace() Dim Newbutton As CommandBarControl With Application .CustomizationContext = ActiveDocument '将自定义命令保存于活动文档 '在常用工具栏的第五个命令之前(即第四个之后) Set Newbutton = .CommandBars("Standard").Controls.Add(Type:=msoControlButton, Before:=5) With Newbutton '加载的图片全路径 .Picture = LoadPicture("C:\Documents and Settings\My Documents\My Pictures\0041.bmp") .Style = msoButtonIconAndCaption '图像与文本 .Caption = "It's a test!" '标题 .Visible = True '显示 .OnAction = "mySub" '运行指定的过程名 End With End With End Sub '---------------------- Sub mySub() MsgBox "It's only a Example" End Sub '---------------------- |