读书人

根据字符串窗口名来关闭一个窗口解决

发布时间: 2012-02-03 22:02:47 作者: rapoo

根据字符串窗口名,来关闭一个窗口
知道一个窗口名,但它是字符串,怎样关闭这个的窗口。用close不行啊,它的参数是windowname类型。

[解决办法]
简单一写,没有 测试

window activesheet,firstsheet
string mtext

firstsheet = w_frame.GetActiveSheet()
if not IsValid(activesheet) then return
activesheet = w_frame.GetActiveSheet()
do while IsValid(activesheet) THEN
if activesheet.Title = "xxxx " then
close(activesheet)
exit
end if
if activesheet =firstsheet then
exit
end if
activesheet = w_frame.GetNextSheet ( activesheet )
END IF

读书人网 >PB

热点推荐