|
-
Dec 29th, 2005, 04:35 PM
#1
Thread Starter
Lively Member
[RESOLVED] capturing file format in file list box
hey all..
how can i capture the format (example: .exe, .txt) of a file being displayed in a file list box??
-
Dec 29th, 2005, 04:44 PM
#2
Re: capturing file format in file list box
Use the properties - File1.Path and/or File1.FileName
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 29th, 2005, 04:45 PM
#3
Re: capturing file format in file list box
Are you sure you're in the right place, sevenhalo? This is VB6 forum...
-
Dec 29th, 2005, 04:49 PM
#4
Thread Starter
Lively Member
Re: capturing file format in file list box
So how will it go??
For example:
If file1.filename = *.wav then
mmcontrol1.devicetype = "Wave Audio"
end if
like that??
-
Dec 29th, 2005, 04:50 PM
#5
Re: capturing file format in file list box
This will tell you what is selected.
VB Code:
Private Sub File1_Click()
MsgBox File1.List(File1.ListIndex)
End Sub
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 29th, 2005, 04:55 PM
#6
Re: capturing file format in file list box
This will parse the file extension and add an asterisk in front of it.
VB Code:
Option Explicit
Private Sub File1_Click()
MsgBox "*" & Mid$(File1.List(File1.ListIndex), InStrRev(File1.List(File1.ListIndex), "."))
End Sub
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 29th, 2005, 05:01 PM
#7
Thread Starter
Lively Member
Re: capturing file format in file list box
thanx for the effort...but let me clarify ...
Im designing a media player...something that plays music (for now)...and im using a multi media control...so i need to specify a "device type" based on the file extension for the file im trying to play...
and since i dont know whats the file extension...i have to capture it from the file list box...
thus: for example:
if (statement to capture the extension) = .wav then
mmcontrol1.devicetype = "Wave Audio"
end if
-
Dec 29th, 2005, 05:03 PM
#8
Thread Starter
Lively Member
Re: capturing file format in file list box
sorry didnt see ur last post...i think that will work...thanxx
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|