Home > Archive > Visual Basic Controls > January 2005 > File Name and Path for Common Dialog Control
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
File Name and Path for Common Dialog Control
|
|
| itaudit 2005-01-24, 4:00 am |
| Does anyone have an example of a parsing routine that returns the File Name
and File Path from the Common Dialog Control?
Thanks!
| |
| Björn Holmgren 2005-01-24, 8:58 am |
| "itaudit" <itaudit@discussions.microsoft.com> wrote in message
news:DD189721-A1DD-4D54-BA50-DC251243189F@microsoft.com...
> Does anyone have an example of a parsing routine that returns the File
Name
> and File Path from the Common Dialog Control?
>
> Thanks!
Function FileNameFromCD(ctlCD As CommonDialog) As String
FileNameFromCD = StrReverse(Split(StrReverse(ctlCD.FileName), "\",
2)(0))
End Function
Function FilePathFromCD(ctlCD As CommonDialog) As String
FilePathFromCD = StrReverse(Split(StrReverse(ctlCD.FileName), "\",
2)(1))
End Function
--
Björn Holmgren
| |
| Randy Birch 2005-01-26, 4:00 pm |
| <g> now that's thinking!
--
Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
"Bjvrn Holmgren" <bjohol@hotmail.com> wrote in message
news:2t2Jd.16371$Of5.11402@nntpserver.swip.net...
: "itaudit" <itaudit@discussions.microsoft.com> wrote in message
: news:DD189721-A1DD-4D54-BA50-DC251243189F@microsoft.com...
: > Does anyone have an example of a parsing routine that returns the File
: Name
: > and File Path from the Common Dialog Control?
: >
: > Thanks!
:
: Function FileNameFromCD(ctlCD As CommonDialog) As String
: FileNameFromCD = StrReverse(Split(StrReverse(ctlCD.FileName), "\",
: 2)(0))
: End Function
:
: Function FilePathFromCD(ctlCD As CommonDialog) As String
: FilePathFromCD = StrReverse(Split(StrReverse(ctlCD.FileName), "\",
: 2)(1))
: End Function
:
: --
: Bjvrn Holmgren
:
:
:
|
|
|
|
|