如何获得当前加载得dvb文件的文件名
根据站内相关函数改编:Sub dvbload()<BR> Dim i As Integer<BR> Dim objIDE As Object<BR> Set objIDE = Application.VBE<BR> ReDim projects(0 To objIDE.VBProjects.Count - 1, 1)<BR> For i = 0 To objIDE.VBProjects.Count - 1<BR> If objIDE.VBProjects(i + 1).Name = "mytools" Then Exit Sub '1<BR> Next<BR>End Sub
注释1处的name不是自己的mytools.dvb,而是acadproject,请问如何修改才能获得加载的dvb文件名? Application.VBE.activevbproject.FileName 用objIDE.VBProjects(i + 1).FileName 老大,没有filename属性? <p>name 是工程名称,filename 才是文件名,包含路径。</p><p>Sub dvbload()<br/> Dim i As Integer<br/> Dim objIDE As Object<br/> Set objIDE = Application.VBE<br/> For i = 0 To objIDE.vbprojects.count - 1<br/> Debug.Print objIDE.vbprojects(i + 1).FileName<br/> Debug.Print objIDE.vbprojects(i + 1).Name</p><p> Next<br/>End Sub<br/></p><p></p>
页:
[1]