Solved

CommonDialog1.Filter

Posted on 2000-03-14
7
247 Views
Last Modified: 2011-09-20
Hi,

Floowing code can not work. Please correct it.

    CommonDialog1.Filter = "*.txt"
    CommonDialog1.ShowOpen

(VB5)
0
Comment
Question by:victorlong
  • 3
  • 2
  • 2
7 Comments
 
LVL 14

Accepted Solution

by:
mcrider earned 45 total points
ID: 2616295
I think you mean this:


    CommonDialog1.Filter = "(*.txt)|*.txt"
    CommonDialog1.ShowOpen



Cheers!®©
0
 

Author Comment

by:victorlong
ID: 2616351
Adjusted points from 35 to 45
0
 

Author Comment

by:victorlong
ID: 2616352
Hi mcrider,

Why  "(*.txt)|*.txt" can work, my "*.txt" looks nicer than yours :-)
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 3

Expert Comment

by:paulstamp
ID: 2616374
The part before the separator is what gets displayed in the dialog box, what comes after is the filter actually used by the common dialog, thus the first part can be anything you like, ie it can be "Text files|*.txt". The important thing is you need to have both parts for the dialog to function.

You can also provide multiple options in the dropdown (like in Word or Excel) using these separators, ie

commondialog1.filter = "Word Files (*.doc)|*.doc|Text Files (*.txt)|*.txt"

This would produce a dropdown with Word Files (*.doc) and Text files (*.txt) as the options.
0
 

Author Comment

by:victorlong
ID: 2620542
Hi paulstamp,

Thank you so much for your comment that helps me understnd the format.

I still bive the points to mcrider, since he/she did answer my Q.

Cheers.
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2621727
Thanks for the points!


Cheers!®©
0
 
LVL 3

Expert Comment

by:paulstamp
ID: 2622616
victorlong - no problem... I just saw your request for clarification hadnt been answered yet. Happy to help
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SSRS expression Issue finding a string 10 93
SLMGR Switches Are Not Working On KMS Host 3 114
Modifying Conditional Format from VBA code 3 60
Export Data to Different .csv Files 26 115
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question