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

Categories

0 votes
695 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 Reply

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...