S
SF
Hi,
I have a button on a form to let user selecting the photo file and paste it
into a text box but I am unable to strip only the file name (file name +
extension)
Private Sub btnSelectPhoto_Click()
'On Error GoTo ErrHandler
Dim lngFlags As Long
Dim strFilter As String
Dim strPathAndFile As String
Me.AllowDeletions = False
strFilter = ahtAddFilterItem(strFilter, "Compressed Image Files (*.jpg,
*.jff, *.gif, *.tiff )", _
"*.JPG;*.JFF,*.GIF,*.TIF")
strFilter = ahtAddFilterItem(strFilter, "Uncompressed Image Files
(*.bmp, *.wmf)", "*.BMP, *.WMF")
' strFilter = ahtAddFilterItem(strFilter, "Text Files (*.txt)",
"*.TXT")
strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*")
strPathAndFile = ahtCommonFileOpenSave(InitialDir:="C:\", _
Filter:=strFilter, FilterIndex:=1, Flags:=lngFlags, _
DialogTitle:="Choose an Image File")
Me.txtSourceFile = strPathAndFile
End Sub
Could somebody advice. Also, is it possible to set the InitialDir to 'My
Documents\My Pictures'. I am using Office 2003 with Windows XP
SF
I have a button on a form to let user selecting the photo file and paste it
into a text box but I am unable to strip only the file name (file name +
extension)
Private Sub btnSelectPhoto_Click()
'On Error GoTo ErrHandler
Dim lngFlags As Long
Dim strFilter As String
Dim strPathAndFile As String
Me.AllowDeletions = False
strFilter = ahtAddFilterItem(strFilter, "Compressed Image Files (*.jpg,
*.jff, *.gif, *.tiff )", _
"*.JPG;*.JFF,*.GIF,*.TIF")
strFilter = ahtAddFilterItem(strFilter, "Uncompressed Image Files
(*.bmp, *.wmf)", "*.BMP, *.WMF")
' strFilter = ahtAddFilterItem(strFilter, "Text Files (*.txt)",
"*.TXT")
strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*")
strPathAndFile = ahtCommonFileOpenSave(InitialDir:="C:\", _
Filter:=strFilter, FilterIndex:=1, Flags:=lngFlags, _
DialogTitle:="Choose an Image File")
Me.txtSourceFile = strPathAndFile
End Sub
Could somebody advice. Also, is it possible to set the InitialDir to 'My
Documents\My Pictures'. I am using Office 2003 with Windows XP
SF