| | |
need help...
![]() |
•
•
Join Date: Jul 2007
Posts: 35
Reputation:
Solved Threads: 0
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
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
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
CommonDialog1.Filter = "Dat File (*.Dat)|Hdr File (*.Hdr)"
This will give you option to open both type of files
Hi,
use ur code to open Dat file and then get the header file by just replacing last 3 chars:
Or
Regards
Veena
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)
DatFName = CommonDialog1.FileName HdrFName = Replace(LCase(DatFName),".dat",".hdr")
Or
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
DatFName = CommonDialog1.FileName HdrFName = Left(DatFName,Len(DatFName)-3) & "hdr"
Regards
Veena
![]() |
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: guide me pls....
- Next Thread: Add color palette to form
| Thread Tools | Search this Thread |
* 6 2007 access activex add age basic beginner birth bmp calculator cd cells.find click client code college connection connectionproblemusingvb6usingoledb creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit excel excelmacro file filename form header iamthwee image inboxinvb internetfiledownload listbox listview liveperson login looping microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading remotesqlserverdatabase report save search sendbyte sites sql sql2008 sqlserver subroutine tags time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web windows





