ExcelHome技术论坛

 找回密码
 免费注册

QQ登录

只需一步,快速开始

快捷登录

搜索
EH技术汇-专业的职场技能充电站 妙哉!函数段子手趣味讲函数 Excel服务器-会Excel,做管理系统 Excel Home精品图文教程库
HR薪酬管理数字化实战 Excel 2021函数公式学习大典 Excel数据透视表实战秘技 打造核心竞争力的职场宝典
300集Office 2010微视频教程 数据工作者的案头书 免费直播课集锦 ExcelHome出品 - VBA代码宝免费下载
用ChatGPT与VBA一键搞定Excel WPS表格从入门到精通 Excel VBA经典代码实践指南
查看: 3050|回复: 10

这个菜单是怎样加上去的?

[复制链接]

TA的精华主题

TA的得分主题

发表于 2004-7-20 16:22 | 显示全部楼层 |阅读模式

附件中没看见有添加菜单的代码啊!这个菜单是怎样加上去的?

TA的精华主题

TA的得分主题

发表于 2004-7-20 16:27 | 显示全部楼层
这是个模板文件呀!它的代码在模板中。

TA的精华主题

TA的得分主题

发表于 2004-7-20 20:12 | 显示全部楼层

TA的精华主题

TA的得分主题

 楼主| 发表于 2004-7-20 20:32 | 显示全部楼层
以下是引用守柔在2004-7-20 16:27:00的发言: 这是个模板文件呀!它的代码在模板中。

我就看见这一段代码啊,没有看见添加菜单的代码,晕!!!!

Sub 公章() '

' 宏在 2003-6-11 由周民录制并编写 On Error GoTo zm: Dim txt1 As String Dim txt2 As String txt1 = InputBox("请输入公章上文字", "公章制作", "南京财经大学") txt2 = InputBox("请输入公章下文字", "公章制作", "图书馆") Application.ScreenUpdating = False If ActiveDocument.Shapes.Count = 1 Then ActiveDocument.Shapes(1).Delete End If ActiveDocument.Shapes.AddShape(msoShapeOval, 279#, 95.4, 108#, 108# _ ).Select Selection.ShapeRange.Fill.Visible = msoTrue Selection.ShapeRange.Fill.Solid Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 255, 255) Selection.ShapeRange.Fill.Transparency = 0# Selection.ShapeRange.Line.Weight = 3# Selection.ShapeRange.Line.DashStyle = msoLineSolid Selection.ShapeRange.Line.Style = msoLineSingle Selection.ShapeRange.Line.Transparency = 0# Selection.ShapeRange.Line.Visible = msoTrue Selection.ShapeRange.Line.ForeColor.RGB = RGB(255, 0, 0) Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255) Selection.ShapeRange.LockAspectRatio = msoFalse Selection.ShapeRange.Height = 111.95 Selection.ShapeRange.Width = 111.95 Selection.ShapeRange.Rotation = 0# Selection.ShapeRange.RelativeHorizontalPosition = _ wdRelativeHorizontalPositionColumn Selection.ShapeRange.RelativeVerticalPosition = _ wdRelativeVerticalPositionParagraph Selection.ShapeRange.Left = CentimetersToPoints(6.67) Selection.ShapeRange.Top = CentimetersToPoints(0.83) Selection.ShapeRange.LockAnchor = False Selection.ShapeRange.WrapFormat.AllowOverlap = True Selection.ShapeRange.WrapFormat.Side = wdWrapBoth Selection.ShapeRange.WrapFormat.DistanceTop = CentimetersToPoints(0) Selection.ShapeRange.WrapFormat.DistanceBottom = CentimetersToPoints(0) Selection.ShapeRange.WrapFormat.DistanceLeft = CentimetersToPoints(0.32) Selection.ShapeRange.WrapFormat.DistanceRight = CentimetersToPoints(0.32) Selection.ShapeRange.WrapFormat.Type = wdWrapTopBottom ActiveDocument.Shapes.AddTextEffect(msoTextEffect3, txt1, "仿宋_GB2312" _ , 36#, msoFalse, msoFalse, 211.1, 121.1).Select Selection.ShapeRange.Fill.Visible = msoTrue Selection.ShapeRange.Fill.Solid Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 0, 0) Selection.ShapeRange.Fill.Transparency = 0# Selection.ShapeRange.Line.Weight = 1.2 Selection.ShapeRange.Line.DashStyle = msoLineSolid Selection.ShapeRange.Line.Style = msoLineSingle Selection.ShapeRange.Line.Transparency = 0# Selection.ShapeRange.Line.Visible = msoTrue Selection.ShapeRange.Line.ForeColor.RGB = RGB(255, 0, 0) Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255) Selection.ShapeRange.LockAspectRatio = msoFalse Selection.ShapeRange.Height = 67.75 Selection.ShapeRange.Width = 67.75 Selection.ShapeRange.Rotation = 0# Selection.ShapeRange.RelativeHorizontalPosition = _ wdRelativeHorizontalPositionColumn Selection.ShapeRange.RelativeVerticalPosition = _ wdRelativeVerticalPositionParagraph Selection.ShapeRange.Left = CentimetersToPoints(4.27) Selection.ShapeRange.Top = CentimetersToPoints(1.73) Selection.ShapeRange.LockAnchor = False Selection.ShapeRange.WrapFormat.AllowOverlap = True Selection.ShapeRange.WrapFormat.Side = wdWrapBoth Selection.ShapeRange.WrapFormat.DistanceTop = CentimetersToPoints(0) Selection.ShapeRange.WrapFormat.DistanceBottom = CentimetersToPoints(0) Selection.ShapeRange.WrapFormat.DistanceLeft = CentimetersToPoints(0.32) Selection.ShapeRange.WrapFormat.DistanceRight = CentimetersToPoints(0.32) Selection.ShapeRange.WrapFormat.Type = wdWrapTopBottom Selection.ShapeRange.IncrementLeft 0.2 Selection.ShapeRange.IncrementLeft 9# Selection.ShapeRange.IncrementLeft 9# Selection.ShapeRange.IncrementLeft 9# Selection.ShapeRange.IncrementLeft 9# Selection.ShapeRange.IncrementLeft 9# Selection.ShapeRange.IncrementLeft 9# Selection.ShapeRange.IncrementLeft 9# Selection.ShapeRange.IncrementLeft 9# Selection.ShapeRange.IncrementLeft 9# Selection.ShapeRange.IncrementLeft 9# Selection.ShapeRange.IncrementTop -0.45 Selection.ShapeRange.IncrementTop -7.8 Selection.ShapeRange.TextEffect.Tracking = 1.2 Selection.ShapeRange.Adjustments.Item(1) = 210 ActiveDocument.Shapes.AddShape(msoShape5pointStar, 351#, 103.2, 36#, _ 34.2).Select Selection.ShapeRange.Fill.Visible = msoTrue Selection.ShapeRange.Fill.Solid Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 0, 0) Selection.ShapeRange.Fill.Transparency = 0# Selection.ShapeRange.Line.Weight = 1.2 Selection.ShapeRange.Line.DashStyle = msoLineSolid Selection.ShapeRange.Line.Style = msoLineSingle Selection.ShapeRange.Line.Transparency = 0# Selection.ShapeRange.Line.Visible = msoTrue Selection.ShapeRange.Line.ForeColor.RGB = RGB(255, 0, 0) Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255) Selection.ShapeRange.LockAspectRatio = msoFalse Selection.ShapeRange.Height = 35.45 Selection.ShapeRange.Width = 35.45 Selection.ShapeRange.Rotation = 0# Selection.ShapeRange.RelativeHorizontalPosition = _ wdRelativeHorizontalPositionColumn Selection.ShapeRange.RelativeVerticalPosition = _ wdRelativeVerticalPositionParagraph Selection.ShapeRange.Left = CentimetersToPoints(9.21) Selection.ShapeRange.Top = CentimetersToPoints(1.1) Selection.ShapeRange.LockAnchor = False Selection.ShapeRange.WrapFormat.AllowOverlap = True Selection.ShapeRange.WrapFormat.Side = wdWrapBoth Selection.ShapeRange.WrapFormat.DistanceTop = CentimetersToPoints(0) Selection.ShapeRange.WrapFormat.DistanceBottom = CentimetersToPoints(0) Selection.ShapeRange.WrapFormat.DistanceLeft = CentimetersToPoints(0.32) Selection.ShapeRange.WrapFormat.DistanceRight = CentimetersToPoints(0.32) Selection.ShapeRange.WrapFormat.Type = wdWrapTopBottom Selection.ShapeRange.IncrementTop 5.35 Selection.ShapeRange.IncrementTop 7.8 Selection.ShapeRange.IncrementTop 7.8 Selection.ShapeRange.IncrementTop 7.8 Selection.ShapeRange.IncrementLeft -0.1 Selection.ShapeRange.IncrementLeft -9# Selection.ShapeRange.IncrementLeft -9# Selection.ShapeRange.IncrementLeft -9# Selection.ShapeRange.IncrementLeft -9# ActiveDocument.Shapes.AddTextEffect(msoTextEffect1, txt2, "仿宋_GB2312", _ 36#, msoFalse, msoFalse, 265.1, 121.1).Select Selection.ShapeRange.Fill.Visible = msoTrue Selection.ShapeRange.Fill.Solid Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 0, 0) Selection.ShapeRange.Fill.Transparency = 0# Selection.ShapeRange.Line.Weight = 1.2 Selection.ShapeRange.Line.DashStyle = msoLineSolid Selection.ShapeRange.Line.Style = msoLineSingle Selection.ShapeRange.Line.Transparency = 0# Selection.ShapeRange.Line.Visible = msoTrue Selection.ShapeRange.Line.ForeColor.RGB = RGB(255, 0, 0) Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255) Selection.ShapeRange.LockAspectRatio = msoFalse Selection.ShapeRange.Height = 28.35 Selection.ShapeRange.Width = 62.35 Selection.ShapeRange.Rotation = 0# Selection.ShapeRange.RelativeHorizontalPosition = _ wdRelativeHorizontalPositionColumn Selection.ShapeRange.RelativeVerticalPosition = _ wdRelativeVerticalPositionParagraph Selection.ShapeRange.Left = CentimetersToPoints(6.18) Selection.ShapeRange.Top = CentimetersToPoints(1.73) Selection.ShapeRange.LockAnchor = False Selection.ShapeRange.WrapFormat.AllowOverlap = True Selection.ShapeRange.WrapFormat.Side = wdWrapBoth Selection.ShapeRange.WrapFormat.DistanceTop = CentimetersToPoints(0) Selection.ShapeRange.WrapFormat.DistanceBottom = CentimetersToPoints(0) Selection.ShapeRange.WrapFormat.DistanceLeft = CentimetersToPoints(0.32) Selection.ShapeRange.WrapFormat.DistanceRight = CentimetersToPoints(0.32) Selection.ShapeRange.WrapFormat.Type = wdWrapTopBottom Selection.ShapeRange.IncrementTop 2.4 Selection.ShapeRange.IncrementTop 7.8 Selection.ShapeRange.IncrementTop 7.8 Selection.ShapeRange.IncrementTop 7.8 Selection.ShapeRange.IncrementTop 7.8 Selection.ShapeRange.IncrementTop 7.8 Selection.ShapeRange.IncrementTop 3

Selection.ShapeRange.IncrementLeft 5.45 Selection.ShapeRange.IncrementLeft 9# Selection.ShapeRange.IncrementLeft 9# Selection.ShapeRange.IncrementLeft 9# Selection.ShapeRange.IncrementTop 7.8 'Selection.ShapeRange.IncrementLeft 9# Selection.ShapeRange.IncrementLeft 0.65 Selection.ShapeRange.IncrementLeft 0.75 Selection.ShapeRange.IncrementLeft 0.75 Selection.ShapeRange.IncrementLeft 0.75 Selection.ShapeRange.IncrementLeft 0.75 Selection.ShapeRange.IncrementLeft 2.25 Selection.ShapeRange.IncrementTop -4.5 ActiveDocument.Shapes.SelectAll Selection.ShapeRange.Group.Select Application.ScreenUpdating = True Exit Sub zm: MsgBox "由于参数错误输入,导致制作失败", vbCritical, "友情提示" End Sub

TA的精华主题

TA的得分主题

发表于 2004-7-20 22:35 | 显示全部楼层

TA的精华主题

TA的得分主题

发表于 2004-7-21 09:07 | 显示全部楼层

请COFE兄将解密后的文档发给我,或者密码。

我想应该在DOCUMENT-OPEN和Document_close中有代码.

TA的精华主题

TA的得分主题

 楼主| 发表于 2004-7-21 09:40 | 显示全部楼层
以下是引用守柔在2004-7-21 9:07:00的发言:

请COFE兄将解密后的文档发给我,或者密码。

我想应该在DOCUMENT-OPEN和Document_close中有代码.

密码:123

TA的精华主题

TA的得分主题

发表于 2004-7-21 09:55 | 显示全部楼层
以下是引用cofe2000在2004-7-21 9:40:00的发言:

密码:123

Ia3BUToK.zip (17.68 KB, 下载次数: 18)

工具/ 自定义/ 宏:将更改保存于活动文档中。

TA的精华主题

TA的得分主题

 楼主| 发表于 2004-7-21 10:12 | 显示全部楼层
以下是引用守柔在2004-7-21 9:55:00的发言:

工具/ 自定义/ 宏:将更改保存于活动文档中。

晕啊!还是没有看见添加菜单的代码

只有这个啊

Sub test() MsgBox "this is only a test!" End Sub 版主救命啊!!!!!!!!!!!!!!!!!!

TA的精华主题

TA的得分主题

发表于 2004-7-21 10:26 | 显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助
以下是引用cofe2000在2004-7-21 10:12:00的发言:

晕啊!还是没有看见添加菜单的代码

只有这个啊

Sub test() MsgBox "this is only a test!" End Sub 版主救命啊!!!!!!!!!!!!!!!!!!

COFE兄,天热了!

其实很简单的,就是将自定义命令拉到工具栏上,并将其指定为活动文档中的宏,比如,我上传的是test过程,而盖公章文档中指定的宏是“公章”过程。指定的工具栏将有两种保存方式,一种保存于模板中,一种保存于活动文档中。此指定过程没有代码。

您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

手机版|关于我们|联系我们|ExcelHome

GMT+8, 2024-5-4 11:17 , Processed in 0.049601 second(s), 11 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 1999-2023 Wooffice Inc.

沪公网安备 31011702000001号 沪ICP备11019229号-2

本论坛言论纯属发表者个人意见,任何违反国家相关法律的言论,本站将协助国家相关部门追究发言者责任!     本站特聘法律顾问:李志群律师

快速回复 返回顶部 返回列表