Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
567 views
in Technique[技术] by (71.8m points)

ms office - how to get the image information after attaching a picture in Access form like date and time of capture

I would like to fetch image captured information ( Date & Time) after uploading image as attachment in access form. need assistance .


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Got this to work.

Sub GetDatePictureTaken(strFolder, strFileName)
    Dim strDate As String
    Dim objShell, objFolder
    Set objShell = CreateObject("Shell.Application")
    Set objFolder = objShell.NameSpace(strFolder)
    strDate = objFolder.GetDetailsOf(objFolder.ParseName(strFileName), 12)
    strDate = CleanNonDisplayableCharacters(strDate)
    Debug.Print strDate
End Sub

Function CleanNonDisplayableCharacters(strInput)
Dim strTemp As String, strChar As String, i As Integer
      strTemp = ""
      For i = 1 To Len(strInput)
          strChar = Mid(strInput, i, 1)
          If Asc(strChar) < 126 And Not Asc(strChar) = 63 Then
              strTemp = strTemp & strChar
          End If
      Next
      CleanNonDisplayableCharacters = strTemp
End Function

Resources:
Trying to use Shell object and FileSystemObject in VBScript for file manipulation
https://social.technet.microsoft.com/Forums/scriptcenter/en-US/3f220113-8b7c-4d32-9681-cdcc942e1f17/vbscript-systemphotodatetaken-problem


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...