阅读:1469回复:2
过来!帮忙!
我编写的几个模块,运行时总是提示:要求对象。我自认为有对象啊!不知道缺少哪些语句!请帮忙
|
|
1楼#
发布于:2006-08-30 10:50
<P>Dim pElementProperties As IElementProperties<BR> Dim pGraphicsContainer As IGraphicsContainer<BR> Dim pGraphicsContainerS As IGraphicsContainerSelect<BR> Dim pMxDocument As IMxDocument<BR> Set pMxDocument = Application.Document<BR>Set pGraphicsContainer = pMxDocument.FocusMap<BR> Set pGraphicsContainerS = pMxDocument.FocusMap pGraphicsContainerS.UnselectAllElements<BR> Set pElementProperties = pGraphicsContainer.Next<BR> '循环检索<BR> Do While Not pElementProperties Is Nothing<BR> If pElementProperties.Name = "兰州拉面" Then<BR> pGraphicsContainerS.SelectElement pElementProperties<BR> End If<BR> Set pElementProperties = pGraphicsContainer.Next<BR> Loop<BR> <BR> Exit Sub<BR> <BR>ErrorHandler:<BR> MsgBox Err.Description</P>
<P>希望指点</P> |
|
2楼#
发布于:2006-08-30 09:05
<P>最好把报错的代码贴出来!要求对象,估计你的对象没初始化,一直是空,所以才运行不了</P><img src="images/post/smile/dvbbs/em02.gif" />
|
|
|