Custom Microsoft Visual Basic for Applications (VBA) toolbars are not recognized using the ICommandBars.Find method.
上次发布: October 10, 2017ArcGIS for Desktop
漏洞 ID 编号
NIM062743
已提交
November 11, 2010
上次修改时间
June 5, 2024
适用范围
ArcGIS for Desktop
找到的版本
10.0
编程语言
VBA
操作系统
Windows OS
操作系统版本
XP
状态
Will Not Be Addressed
开发团队已考虑过该问题或请求,并决定不会解决该问题。 问题的“其他信息”部分可能包含进一步说明。
附加信息
VBA is not supported. Please migrate all code to .NET
解决办法
Sub FindBar() Dim pCmdBars As ICommandBars Set pCmdBars = ThisDocument.CommandBars Dim pNewBarX As ICommandBar Set pNewBarX = pCmdBars.Find("MyBar") ' If Find method did not get the new command bar above, retry ' with the prefix "Normal". If pNewBarX Is Nothing Then Set pNewBarX = pCmdBars.Find("Normal.MyBar") ' If Find method did not get the new command bar above, retry ' with the prefix "Project". If pNewBarX Is Nothing Then Set pNewBarX = pCmdBars.Find("Project.MyBar") If pNewBarX Is Nothing Then MsgBox "pNewBarX is still Nothing" End If End If End If pNewBarX.Add ArcID.File_AddData pNewBarX.Add ArcID.PanZoom_FullExtentEnd Sub