在表单中添加控件text1(multiline=true,scrollbars=2)和timer1(interval=1000),然后在代码区复制以下代码并运行它,以在text1中实时显示ie中打开的网页源代码:optionexplicitdimoshellapp,oshellappwindows,owindimurllstastingstringprivatesubtimer1utimer()setoshellapp=createobject()外壳.应用)setoshellappwindows=oshellapp.windowsforeachowininoshellappwindowsiff案例(打印名(owin.document文件))=“htmldocument”thenifinstr(1,urllstowin.locationurl,vbtextcompare)=0thenurlst=urlst&owin.locationurl&“,”文本1.text=owin.document.body文件.innerhtmlme.caption=owin.locationnameendifendifnextendsub公司