Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file dialog sucks, but i would sure like some help with it

Status
Not open for further replies.

spizotfl

MIS
Aug 17, 2005
345
US
hi, i am trying to use the built in FileDialog, and the general impression i get is that it is pretty crappy, and i am having that experience.
i am trying to allow someone to save an exported text file, but i am getting an error about the Filters line saying:
Object does not support this method or property.
now when i typed the . Filters was in the list as well as Add before the second dot, so i am having a hard time figuring out how this object doesn't support the property that is in the list, but whatever, this is microsoft and maybe i shouldn't understand this....

Code:
Dim selectedPath As Variant
Dim dlgSaveAs As FileDialog
Set dlgSaveAs = Application.FileDialog(msoFileDialogSaveAs)

With dlgSaveAs
    .AllowMultiSelect = False
    .Filters.Add "Text File", "*.txt"
    If dlgSaveAs.Show = True Then
        For Each selectedPath In .SelectedItems
            MsgBox selectedPath
        Next
    Else
        MsgBox "Cancelled"
    End If
End With

anywho, all i really want is an easyish way of allowing a user to select a file and location (like the file dialog looks like it provides), and store that in a variable that i can pass to TransferText.
 
i did some more hunting and found that site. i also found some posts in various forums that came up in the search that suggested the file dialog save part doesn't work.
thanks for the response
 
the access native saveasfiledialog isn't supported, you can use the open and getfolder dialogs though...

I've actually got a cut down version of what's on the link posted by majp and can confirm that it does work.

--------------------
Procrastinate Now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top