473,382 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

open *.DGN of *.PDF in designated/random folder

Dear All,



Currently i'm using VB6. I have several files of *.dgn or *.pdf within my folder.
For example :
I have chosen random folder (using dialog box) which contains some above files
and some other files. Then, I want my VB6 recognizes the extention DGN or PDF to open. Later on, VB6 will visibly open those files one-by-one.

Please help me... Because, I searched from this VB6 forum only open a
selected file. I'd like to know the code that the folder i've chosen then VB6 is
able to open files that has extention like above.

*note : filename of above extention is random/unknown

Thank you for your great help...
Aug 10 '07 #1
1 1710
Killer42
8,435 Expert 8TB
I'm a bit unclear on which part you want help with. I don't know what to do with DGN or PDF files from VB6. But as for finding just these files, there are a couple of ways. If you use the FileSystemObject (FSO) model, then you can check the file type - not recommended in my opinion, because it varies depending on which application "owns" the files. For example, a JPG file might have a type of "JPEG image" or "Paint Shop Pro Image" or various other things, depending on what's installed.

You can also check the name, and use the Mid() or Right() function to make sure the last 4 characters match ".DGN" or ".PDF".

You can scan through the files in the directory by using the Dir() function. for eample, this will list all the PDF files in the current folder...
Expand|Select|Wrap|Line Numbers
  1. Dim F As String
  2. F = Dir("*.PDF") ' Retrieve the first name matching this pattern.
  3. Do While F <> ""
  4.   Debug.Print F
  5.   F = Dir ' Retrieve the next matching name.
  6. Loop
Aug 10 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: SoulSniper | last post by:
Hi, I have been stuck on this for a few days now and have given up trawling through pages and pages of google results.. I'm just putting the finishing touches to a small game I've written....
29
by: Bill Marsden | last post by:
Hi. I am an under-graduate currently studying Open Source (Linux) vs Closed Source and Collaboration within the IT Community. I am fairly new to Javascript and I have written a "Lottery Program"...
4
by: Baz | last post by:
I want to randomly select some files from a source directory & copy them to a target folder for testing. How can I select files from the source directory randomly? I have thought about getting a...
4
by: tshad | last post by:
I am trying to set up an Image authorization where you type in the value that is in a picture to log on to our site. I found a program that is supposed to do it, but it doesn't seem to work. ...
1
by: KoRnDragon | last post by:
I need a Javascript function that will display X random images on a page that also doesn't display the same image twice. Bonus points if it grabs the max array from the folder and sets it. Even...
1
by: Sahus Pilwal | last post by:
Hi, I hope someone can help me with this. I'm new to .NET and in fact server side programming and have a small query I'm sure... I'm using the System.IO Namespace with a For - each and If then...
10
by: howa | last post by:
for example, there are 10K files in the directory, given that i don't know if files name, is it possible to fetch a file randomly? thanks.
5
by: barnetod | last post by:
I am trying to open a text file designated by the user. Then I want to change all lower case values to capital letters. Then write file. I am stuck and can not change the characters or am...
1
by: Sunshine192 | last post by:
Hi, I'm still kinda new to PHP so I could do with some advice. I'm using the code below to select and show a random image from a folder of images. rotate.php <?php // Make this the relative...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.