473,545 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

4 New Member
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 1714
Killer42
8,435 Recognized Expert Expert
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 FileSystemObjec t (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
3783
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. The game uses the FMOD sound library to play an MP3 as background music. I got slightly bored of listening to the same song over and over and realised...
29
2249
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" which essentially picks 6 numbers at random and puts them in sequence. Would anyone would be interested in modifying the code below to a). Check...
4
7217
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 count of the total files in the folder & then using a random number generator to select files based on count. Is there another more efficient way...
4
2739
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. It should put a blue and yellow box on the page with "This is a test" as part of the picture. But what I get is a broken Gif. The other problem is...
1
1763
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 more points if it grabs all the image names from the folder. Thanks in advance!
1
2644
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 statement to randomly generate images to display in a <asp:image/image control. The random images are selected from a fixed folder on the...
10
10604
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
2344
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 not writing correctly. Please let me know what I can do to fix this.
1
2469
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 path to the images, like "../img" or "random/images/". // If the images are in the same directory, leave it blank. $folder = ''; // Space...
0
7499
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7432
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7456
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6022
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3490
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3470
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1919
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
743
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.