在vb中output函数如何把当天日期作为文件名输出?

来源:百度知道 编辑:UC知道 时间:2024/05/16 05:51:40
在vb中output函数如何把当天日期作为文件名输出?
如把20061112作为文件名输出

dim fname as string
fname=format(now,"yyyyymmdd")
fname=app.path & "\" & fname & ".dat"
open fname for output as #1
print #1,*****
....

Open App.Path & "\" & Format(Date, "yyyymmdd") & ".txt" For Output As #1
Write #1, "123456" '
Close #1