commondialog 设置默认另存为文件名为textbox text值无法showsave
请教个小问题:我设置commondialog控件另存为对话框的默认文件名为文本框textbox的text值,但执行showsave不能打开另存为对话框.我的代码是: text2.text="让MSHFlexGrid不再显示多余的小数"
Private Sub Command1_Click()
With CommonDialog1
.FileName = ""
.Filter = "*.txt|*.txt|*.rtf|*.rtf|*.*|*.*"
.DialogTitle = "另存为"
.FileName = Trim(Text2.Text)
.CancelError = True '捕获 取消 错误时得先设置为true 然后再showsave
On Error GoTo ErrorHandler
.ShowSave
End With
ErrorHandler:
Exit Sub
End Sub