阅读:1623回复:1
VBA+arcMap 创建新菜单能否用自己的
<P>在arcmap中利用VBA创建了新菜单,但是菜单关联的命令好像必须是build in command。能不能用菜单调用自己的写的模块啊?或者在VB+AO中创建新菜单后能调用自己的模块吗?我查遍了网页,都是调用系统本身的命令。好像就是可以重新组合一下arcmap自己的命令啊?请高手指点。谢谢!!</P>
<P> '添加菜单<BR> ' Find the MainMenuBar.<BR> Dim pMainMenuBar As ICommandBar<BR> Set pMainMenuBar = Application.Document.CommandBars.Find(ArcID.MainMenu)</P> <P> ' Create the new menu called "MyMenu" on the MainMenuBar.<BR> Dim pNewMenu As ICommandBar<BR> Set pNewMenu = pMainMenuBar.CreateMenu("计算", 6)</P> <P> ' Add a built in command to the new menu.<BR> ' The built in ArcID module is used to get the command ID for the AddDate command.<BR> 'pNewMenu.Add ArcID.View_StatusBar</P> <P> Set pNewMenu = pMainMenuBar.CreateMenu("查询", 7)<BR> pNewMenu.CreateMacroItem "按属性查询", 2, "ThisDocument.AttributeQuery"</P> <P>这段代码在ARCMap的VBA中总数报错。提示就是不能调用<BR> </P> |
|
1楼#
发布于:2007-06-14 10:39
可以自己编写dll来定制菜单并调用相应的模块,这个在软件的帮助的例子里也有
|
|
|