Private Sub c01_Click()
If ps = "" Then
MsgBox ("请填写完整信息后再操作本项!")
Else
'查询色彩季节'生成文件
text1.Text = FileContent(App.Path & "\doc1\" & ps & ".htm")
text1.Text = Replace(text1.Text, "$r$username$f$", username)
text1.Text = Replace(text1.Text, "$r$bh$f$", bh)
text1.Text = Replace(text1.Text, "$r$time$f$", Date$)
text1.Text = Replace(text1.Text, "$r$ys$f$", rs("ys"))
text1.Text = Replace(text1.Text, "$r$ys1$f$", rs("ys1"))
text1.Text = Replace(text1.Text, "$r$jy$f$", rs("jy"))
text1.Text = Replace(text1.Text, "$r$sd$f$", rs("sd"))
If Dir(App.Path & "\user\" & bh & username, vbDirectory) = "" Then
MkDir App.Path & "\user\" & bh & username
End If
Open App.Path & "\user\" & bh & username & "\" & "色彩诊断方案.htm" For Output As #1
Print #1, text1.Text
Close #1
Dim RetVal
RetVal = Shell("C:\Program Files\Internet Explorer\IEXPLORE.EXE " & App.Path & "\user\" & bh & username & "\" & "色彩诊断方案.htm", 1)
MsgBox "成功生成!文件信息:" & App.Path & "\user\" & bh & username & "\" & "色彩诊断方案.htm"
End If
End Sub
叫谁帮看看你定义ps是什么没有?