Reply

Join Date: Jul 2007
Posts: 35
Reputation: coco86 is an unknown quantity at this point 
Solved Threads: 0
coco86 coco86 is offline Offline
Light Poster

need help...

 
0
  #1
Aug 14th, 2007
hi.. I have a problem on opening 2 file ... as below is my code... I want to open 1 file let's say .Dat file and it will trigger the other .Hdr file. the only different is the extension name , 11U06P0434FN.dat and 11U06P0434FN.hdr .... anyone can help me .... please .

CommonDialog1.Filter = ".Dat"
CommonDialog1.InitDir = App.Path & "\BatchFile"
CommonDialog1.FileName = ""
CommonDialog1.ShowOpen

txtdata(0).Text = rtndirectory(Trim(CommonDialog1.FileTitle))
If Trim(CommonDialog1.FileName) = "" Then Exit Sub
DatFName = CommonDialog1.FileName

CommonDialog1.ShowOpen
txtdata(1).Text = rtndirectory(Trim(CommonDialog1.FileTitle))
HdrFName = CommonDialog1.FileName

End Sub
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 645
Reputation: binoj_daniel is an unknown quantity at this point 
Solved Threads: 17
binoj_daniel's Avatar
binoj_daniel binoj_daniel is offline Offline
DaniWeb Expert

Re: need help...

 
0
  #2
Aug 14th, 2007
So if you mean that you don't get the option to open multiple type files, then you need to change your code slightly.

CommonDialog1.Filter = "Dat File (*.Dat)|Hdr File (*.Hdr)"

This will give you option to open both type of files
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 35
Reputation: coco86 is an unknown quantity at this point 
Solved Threads: 0
coco86 coco86 is offline Offline
Light Poster

Re: need help...

 
0
  #3
Aug 14th, 2007
thnx binoj_daniel..
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 645
Reputation: binoj_daniel is an unknown quantity at this point 
Solved Threads: 17
binoj_daniel's Avatar
binoj_daniel binoj_daniel is offline Offline
DaniWeb Expert

Re: need help...

 
0
  #4
Aug 14th, 2007
Let me know if that worked?
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 645
Reputation: binoj_daniel is an unknown quantity at this point 
Solved Threads: 17
binoj_daniel's Avatar
binoj_daniel binoj_daniel is offline Offline
DaniWeb Expert

Re: need help...

 
0
  #5
Aug 14th, 2007
you can also register on my site for more tech articles. click here to visit my site
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 848
Reputation: QVeen72 is on a distinguished road 
Solved Threads: 120
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Practically a Posting Shark

Re: need help...

 
0
  #6
Aug 15th, 2007
Hi,

use ur code to open Dat file and then get the header file by just replacing last 3 chars:

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. DatFName = CommonDialog1.FileName
  2. HdrFName = Replace(LCase(DatFName),".dat",".hdr")

Or

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. DatFName = CommonDialog1.FileName
  2. HdrFName = Left(DatFName,Len(DatFName)-3) & "hdr"

Regards
Veena
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 35
Reputation: coco86 is an unknown quantity at this point 
Solved Threads: 0
coco86 coco86 is offline Offline
Light Poster

Re: need help...

 
0
  #7
Aug 15th, 2007
thnx veena , it works .... i use the 2nd one u gave me.... thnx alot.....
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 35
Reputation: coco86 is an unknown quantity at this point 
Solved Threads: 0
coco86 coco86 is offline Offline
Light Poster

Re: need help...

 
0
  #8
Aug 15th, 2007
thnx veena .... it works .... i use the 2nd one u gave me..... appreciate it....
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC