Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

need to add a browse button to my email project for attachments

ishraqishraq Member Posts: 20
hi,
i need to add a browse button to my email project to add an attachment..
all i need the button to do is open a normal browse window, n when clicked on the file to be attached, it should copy the file's path onto a text box..
the rest would be done by the prog..
thanx in advance..
tc

Comments

  • BitByBit_ThorBitByBit_Thor Member Posts: 2,444
    : hi,
    : i need to add a browse button to my email project to add an
    : attachment..
    : all i need the button to do is open a normal browse window, n when
    : clicked on the file to be attached, it should copy the file's path
    : onto a text box..
    : the rest would be done by the prog..
    : thanx in advance..
    : tc
    :
    :

    CommonDialogControl for VB6
    .NET languages have OpenFileDialog

    If you need an example of how to use them (for instance, which properties need to be set how) I could help, but please tell me which VB version you are using.

    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
  • ishraqishraq Member Posts: 20
    : : hi,
    : : i need to add a browse button to my email project to add an
    : : attachment..
    : : all i need the button to do is open a normal browse window, n when
    : : clicked on the file to be attached, it should copy the file's path
    : : onto a text box..
    : : the rest would be done by the prog..
    : : thanx in advance..
    : : tc
    : :
    : :
    :
    : CommonDialogControl for VB6
    : .NET languages have OpenFileDialog
    :
    : If you need an example of how to use them (for instance, which
    : properties need to be set how) I could help, but please tell me
    : which VB version you are using.
    :
    : Best Regards,
    : Richard
    :
    : The way I see it... Well, it's all pretty blurry
    hi,
    thanx fo replying..
    im using vb6
    awaiting ur ans.. :)
    tc

  • BitByBit_ThorBitByBit_Thor Member Posts: 2,444
    Common Dialog Control

    [code]
    With dlgFile
    .DialogTitle = "Select file to open..."
    'Filter: description1 | extension1 | description2 | etc...
    .Filter = "Text files (*.txt)|*.txt|All files|*.*"
    .FilterIndex = 1
    .Flags = cdlOFNFileMustExist Or cdlOFNHideReadOnly Or cdlOFNLongNames
    .ShowOpen

    MsgBox "User selected " & .FileName
    End With
    [/code]


    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
  • FyeRooFyeRoo Member Posts: 5
    : Common Dialog Control
    :
    : [code]:
    : With dlgFile
    : .DialogTitle = "Select file to open..."
    : 'Filter: description1 | extension1 | description2 | etc...
    : .Filter = "Text files (*.txt)|*.txt|All files|*.*"
    : .FilterIndex = 1
    : .Flags = cdlOFNFileMustExist Or cdlOFNHideReadOnly Or cdlOFNLongNames
    : .ShowOpen
    :
    : MsgBox "User selected " & .FileName
    : End With
    : [/code]:
    :
    :
    : Best Regards,
    : Richard
    :
    : The way I see it... Well, it's all pretty blurry

    What I did to put the path on the text box is this
    (im using .net, it might work on vb6 not sure)

    textboxtodisplaypath.Text = dialogname.FileName

  • BitByBit_ThorBitByBit_Thor Member Posts: 2,444
    Oh btw, did I tell you you need to add the control to the form first?

    In the VB6 IDE go to components and then add Microsoft Common Dialog Control to your project. Then, add a Dialog Control to you form.
    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
  • ishraqishraq Member Posts: 20
    : : Common Dialog Control
    : :
    : : [code]: :
    : : With dlgFile
    : : .DialogTitle = "Select file to open..."
    : : 'Filter: description1 | extension1 | description2 | etc...
    : : .Filter = "Text files (*.txt)|*.txt|All files|*.*"
    : : .FilterIndex = 1
    : : .Flags = cdlOFNFileMustExist Or cdlOFNHideReadOnly Or cdlOFNLongNames
    : : .ShowOpen
    : :
    : : MsgBox "User selected " & .FileName
    : : End With
    : : [/code]: :
    : :
    : :
    : : Best Regards,
    : : Richard
    : :
    : : The way I see it... Well, it's all pretty blurry
    :
    : What I did to put the path on the text box is this
    : (im using .net, it might work on vb6 not sure)
    :
    : textboxtodisplaypath.Text = dialogname.FileName
    :
    :
    hi,
    i added a commondialog control and copied the above code to a button..
    but when i click it..'object required' error comes... what could i be doing wrong? thanx..
    tc

  • BitByBit_ThorBitByBit_Thor Member Posts: 2,444
    : hi,
    : i added a commondialog control and copied the above code to a
    : button..
    : but when i click it..'object required' error comes... what could i
    : be doing wrong? thanx..
    : tc
    :
    :

    Rename it to dlgFile.

    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
  • ishraqishraq Member Posts: 20
    : : hi,
    : : i added a commondialog control and copied the above code to a
    : : button..
    : : but when i click it..'object required' error comes... what could i
    : : be doing wrong? thanx..
    : : tc
    : :
    : :
    :
    : Rename it to dlgFile.
    :
    : Best Regards,
    : Richard
    :
    : The way I see it... Well, it's all pretty blurry




    thank u!!, thank u!! thank u!!! :) :) :)
  • ladiesman217ladiesman217 Member Posts: 1
    : : : hi,
    : : : i added a commondialog control and copied the above code to a
    : : : button..
    : : : but when i click it..'object required' error comes... what could i
    : : : be doing wrong? thanx..
    : : : tc
    : : :
    : : :
    : :
    : : Rename it to dlgFile.
    : :
    : : Best Regards,
    : : Richard
    : :
    : : The way I see it... Well, it's all pretty blurry
    :
    :
    :
    :
    : thank u!!, thank u!! thank u!!! :) :) :)
    :


    Hi, how can I automatically set the dialog to:

    1.) view the files by details
    2.) sort the files by date

    Also, I want the dialog to display only text files with the word "2007" on the file names. Is it possible?

    Any help will be much appreciated. ThaNKS A LOT!!



Sign In or Register to comment.