增加一个自定义函数名称:abc,函数内容
dim dir as string = args(0)
dim txt as string = args(1)
For Each File As String In FileSys.GetFiles(dir ) If file.EndsWith(txt & ".xls") Then return File End If Next |
For Each dir2 As String In FileSys.GetDirectories(dir) 如果有子目录
dim s as string = Functions.Execute("abc",dir2 txt )
if s > "" then
retutn s
end if
Next
return ""
按钮
Dim txt As String = e.Form.Controls("TextBox1").Text
Dim web As WinForm.WebBrowser = e.Form.Controls("WebBrowser1")
dim file as string = Functions.Execute("abc","l:\产品料单",txt )
If file > "" Then
web.OfficeToolBar = True
web.Address = File
else
msgbox("没有找到")
End If