CDlg.ShowSave
CDlg.FileName 是獲得文件的路徑和名稱

解决方案 »

  1.   

    Private Sub Command1_Click()
    ' 设置“CancelError”为 True
    CommonDialog1.CancelError = True
    On Error GoTo ErrHandler
    ' 设置标志
    CommonDialog1.Flags = cdlOFNHideReadOnly
    ' 设置过滤器
    CommonDialog1.Filter = "All Files (*.*)|*.*|Text Files" & _
    "(*.txt)|*.txt|Batch Files (*.bat)|*.bat"
    ' 指定缺省的过滤器
    CommonDialog1.FilterIndex = 2
    ' 显示“打开”对话框
    CommonDialog1.ShowSave
    ' 显示选定文件的名字
    MsgBox CommonDialog1.filename
    Exit SubErrHandler:
    ' 用户按了“取消”按钮
    Exit Sub
    End Sub
      

  2.   

    和FSO对象配合起来使用效果会更好
      

  3.   

    我用了WebBrowser控件,我想知道如何用ShowSave把当前页面存储下来?
    一定给分的
      

  4.   

    cdgMain.Flags = cdlOFNHideReadOnly
    cdgMain.DefaultExt = "htm"
    cdgMain.Filter = _
        "HTML Files(*.htm *.html)|*.htm;*.html|All Files(*.*)|*.*"
    cdgMain.InitDir = App.Path
    'cdgMain.FileTitle = brwWebBrowser.LocationName
    cdgMain.ShowSave
    上面注释那一句总提示property is read-only
      

  5.   

    cdgMain.Filename = brwWebBrowser.LocationName
      

  6.   

    Jneu(沧海桑田) 这样写不行。
      

  7.   

    cdgMain.DialogTitle = brwWebBrowser.LocationName
      

  8.   

    这是commondialog.showsave 显示打开对话框的方法。Jneu说的对,就那样用。被选定的文件路径,就是commondialog.filename 属性
      

  9.   

    就是如何通过commondialog对话框把WebBrowser的叶面内容存储倒一个*.htm文件当中
    要有存储过程。譬如
    CommonDialog1.CancelError = False
    CommonDialog1.DefaultExt = "txt"
    CommonDialog1.InitDir = "c:\temp"
    CommonDialog1.Filter = "Text Files|*.txt|All Files|*.*"
    CommonDialog1.ShowOpenIf CommonDialog1.FileTitle = Empty Then
        Exit Sub
    End IfRichTextBox1.LoadFile (CommonDialog1.FileName)
    打开文件
    CommonDialog1.CancelError = False
    CommonDialog1.DefaultExt = "txt"
    CommonDialog1.InitDir = "c:\temp"
    CommonDialog1.Filter = "Text Files|*.txt|All Files|*.*"
    CommonDialog1.ShowSave
    RichTextBox1.SaveFile (CommonDialog1.FileName)
    存储文件现在我只想通过commondialog对话框把WebBrowser的叶面内容存储倒一个*.htm文件当中
      

  10.   

    具体怎么实现存储过程?
    譬如给定浏览页面
    brwWebBrowser的文件名是 新浪
    地址是 http://www.sina.com.cn
    现在存储成ttt.htm
    怎么存储?可以加倒300分
      

  11.   

    CommonDialog1.Action = 1(~5 自己试)